Welcome! Log In Create A New Profile

Advanced

Put custom maintenance page for complex config with multiple locations.

Posted by maxdao 
Put custom maintenance page for complex config with multiple locations.
August 27, 2012 07:07AM
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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 149
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready