I would like to remap the 502 and 504 errors generated by Nginx when it can’t talk to the proxy successfully into 408 errors.
To be clear, when Nginx returns 502/504 and no body, it should instead return 408 and still no body.
I tried adding this directive, but it apparently corrupts the response headers:
error_page 502 =408;
error_page 504 =408;
Any idea how to do remap an Nginx error code?
http://nginx.org/r/error_page
You forgot to specify the
uriparameter (your=408argument has been interpreted as a uri).upd: