How to configure nginx to hold the connections and retry if the proxied server returns 502?
Anonymous
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?