Handling 404 errors

Friscia, Michael michael.friscia at yale.edu
Thu May 24 16:08:25 UTC 2018

I need some thoughts on this problem.

I am load balancing upstream servers, two are IIS servers on VMs and one is an Azure App Service (PaaS) web app. During deployment the apps are shut down and reloaded. The problem is that the Azure web app returns a 403 when it is shut down, so Nginx serves stale content. But the IIS servers return a 404 error. Since we don’t serve stale content to a 404 (nor would we want to) it means that we need to come up with a solution to work around this.

The only thing I can tell is that when the IIS site is turned off there is a response header of Connection: close. But if I start the site up and force a 404 error, I get this header which does not appear when the site is turned off: X-Powered-By: ASP.NET.

My question is if there is a way to manipulate the values in the proxy_cache_use_stale to include http_404 but only under special circumstances. Or if there is some other way to include some logic that would allow me at the server block level to force serving stale content.

I appreciate any thoughts/ideas how to overcome this. I’ve tried to find out if I can force IIS to serve a 403 error and have not had much luck and in all honesty, I am trying not to customize IIS and would rather focus customization on Nginx configuration files.


Michael Friscia
Office of Communications
Yale School of Medicine
(203) 737-7932 - office
(203) 931-5381 - mobile

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20180524/0816b630/attachment-0001.html>

More information about the nginx mailing list