Created
November 4, 2015 14:11
-
-
Save binary1230/186c7ce8d79601e04b42 to your computer and use it in GitHub Desktop.
maintenance page on nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if /var/www/maintenance.html exists, don't use the proxy, instead, redirect everything to the maintenance page | |
# if it doesn't exist, proceed as normal | |
server #WHATEVER# { | |
location #WHATEVER# { | |
if (-f /var/www/maintenance.html) { | |
return 503; | |
} | |
# REST OF NORMAL STUFF | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
root /var/www/; | |
rewrite ^(.*)$ /maintenance.html break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment