Sign in
Log inSign up
How to configure nginx to hold the connections and retry if the proxied server returns 502?

How to configure nginx to hold the connections and retry if the proxied server returns 502?

Default profile photo
Anonymous
·Mar 11, 2016

I have a NodeJS app that sometimes sends 502 status code when the app is rebooting. Nginx is configured as a reverse proxy and as a result nginx also returns 502.

How do I setup Nginx so that it retries and forwards the connection to backend proxied server 2-3 times in case of 502 responses?