I’m trying implement maintenance page for site with complex nginx config structure. Base idea is trivial, and something like
try_files /maitanance.html /$uri $uri;
or
if (-f /var/www/close_site) {
return 503;
}
Error_page 503 @maintanance;
The issue is site have lots of custom locations, like:
Location /
Location /home
Location /dashboard
location /stats
Also site uses SSI for some of the locations, and memcached as cache for some locations. That’s why putting maintenance code at one location or at server level will not work (if there are custom location for specific URL defined).
Possible solution is putting maintenance code in all locations (using include), but anyway it looks durty.
What will you suggest? Putting code to all locations using include or there are any proper way having maintenance code at one place?
Thanks in advance.