Hi
I encountered a problem, that is, I used Nginx in the front and apache in the back.
But sometimes when apache restarts (assuming the restart is not smooth), nginx will immediately return 502.
How to make nginx connect to the backend (such as apache), if the backend is in an unresponsive state, or is not started, Nginx will retry N times and return 502?
Instead of returning 502 immediately, thank you!
nginx reverse proxy cannot find apache and will definitely report a 502 error. The service is unavailable at this time. Even if the error is reported after retrying n times, the service will hang during the retry process, but the 502 error will not be displayed.
I think what you want is not to display a 502 error even if nginx makes an error. So, is it okay to directly block the 502 error?