Change proxy_cache options depending on status code received

Serban Teodorescu teodorescu.serban at gmail.com
Thu Sep 8 14:58:07 UTC 2022


Hello,

I’d like to configure nginx to put up a standard maintenance page depending on the status code received from the upstream (currently for 502, 503 and 504, cached for 3 minutes).

This works pretty simple and well, but I would like to ensure the maintenance page is being served directly on all urls.

Currently the cache_key contains $request_uri ar the end, of course, to make sure the caching is working properly when everything is fine.

Would you be able to please point into the right direction? 

Thank you!


More information about the nginx mailing list