Home > Net >  Is it possible to stop nginx from responding when Node.js API goes down?
Is it possible to stop nginx from responding when Node.js API goes down?

Time:10-28

I'm just wondering if it's possible to somehow stop nginx from responding to requests, when my Node API goes down? And when the API comes back up, start responding to requests again.

I would like to do this because it would fix issues with my uptime monitor. When the API goes down, nginx continues to return code 502 to every request, and my uptime monitor sees this as a response and does not show that the API is down.

CodePudding user response:

The smarter way would in my opinion be to adjust the uptime monitor to interpret every 5xx as an error and therefore no uptime as per HTTP standard 5xx Status Codes are always errors.

  • Related