How to customize 502 page in Node.Js? - node.js

When I try to access my URL running a Node.js app, when the app not running, the page shows
502 – Bad Gateway
The page you requested is currently unavailable. Please try again
later.
If you are the website owner, please see Error: 502 Bad Gateway
documentation for more information and possible steps to resolve the
problem.
It's hosted on webfaction.
Is there a way to customize what shows on this page?

This error isn't caused by node.js; it is caused by a proxy between you and node.js. This may mean that your server isn't running. Try contacting webfaction.

Related

Failed to load resource: net::ERR_CONNECTION_REFUSED, Error after deploy

I developed a website using react and node.js, and my team deploy it on the server, the problem is when we try to use the website using the new domain or IP address it gives us this error:
Although it works fine in the localhost:3000 in the server, can you please give me the hints to solve this
I also faced the same issue because of not updating
backend URL so make sure to check the backend URL in the frontend. If you host any cloud-like Heroku then include on .env
In your case, there might be some other reason as well.

Nuxtjs server side rendering could not call to the api behind cloudflare

We are building a project with NuxtJS. The API is deployed on AWS and used Cloudflare to set up DNS.
Sending the request to asyncData(), inside this method we made the call to API via domain(the domain pointed to actual load balancer URL of AWS - by setting up CNAME in Cloudflare). The error 503 was returned. Looks like the call is occurring inside of nodejs server. If anyone was familiar with this situation, please give me a hand. Thanks in advance.
Also noticed that, this is not appearing when calling the API with nuxtjs from the browser. As I understand, nuxtjs's asyncData is executed from the server, while on navigation it executed from browser.

Intermittent 502 when using cloudflare on azure

I am hosting my website on azure and using cloudflare for dns and proxy.
Recently I started experiencing a problem where if I refresh a page a number of times, eventually I get the cloudflare 502 page. Refreshing the page again and it loads fine.
If I refresh the page without using cloudflare, i.e. I go straight to {mydomain}.azurewebsites.net I don't get the issue.
So obviously the problem is server/cloudflare side config. Any ideas on what could be causing this?
I think it is related to this issue: https://community.cloudflare.com/t/random-502-errors-for-last-3-days-caused-by-illegal-request-header-injected-by-cf-reverse-proxy/202061
The 502 Bad Gateway error is an HTTP status code that means that one server on the internet received an invalid response from another server... so as it stands you don't have enough information to figure out what is going on here.
You will need to find a way to get the web server logs from your server on Azure and possibly also the logs from Cloudflare.

IIS server : Failed to load resource: net::ERR_HTTP_1_1_REQUIRED

I have recently migrated my portal into IIS server through iisnode. I see the error
POST https://portal.website/api/abc net::ERR_CONNECTION_RESET 200 (OK)
POST https://portal.website/api/xyznet::ERR_CONNECTION_RESET 200 (OK)
I tried to see if all the settings inside IIS is good. All the settings seems to be perfect.
Can anyone suggest what is going wrong?
If there is post Http Reset for API, please check the data fetched by this API. This might be due to API getting timeout.

calls to external web api Access-Control-Allow-Origin error 502 nodejs

I need to call an external web api which runs on the same server as my application, but don't get permission to do so. When I run the application locally, it works fine. But when I deploy it, error 502 on every remote request.
I searched to the suggested questions when I made this question.
Is it possible to have the same issue as him: Steam API Access-Control-Allow-Origin Issue
Because there was no way around this problem. We hosted everything on the same server, so there couldn't occur an Access control allow origin error.

Resources