Change proxy_cache options depending on status code received

Serban Teodorescu teodorescu.serban at gmail.com
Thu Sep 8 15:01:43 UTC 2022


I should also add that currently this works really well for every distinct $request_url by:


location / {
	…
	error_page 500 502 503 504 /maintenance.html;
	…
	proxy_cache_valid 500 502 503 504 3m;
}

location = /maintenance.html {
	root /etc/nginx/static;
}



More information about the nginx mailing list