Created
April 22, 2011 17:43
-
-
Save trobrock/937199 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
location / { | |
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
try_files $uri $uri/index.html @proxy; | |
} | |
error_page 503 @503; | |
location @503 { | |
# Serve static assets if found when in maintenance mode. | |
if (-f $request_filename) { | |
break; | |
} | |
# Serve the maintenance page if we're in maintenance mode. | |
if (-f $document_root/system/maintenance.html) { | |
rewrite ^(.*)$ /system/maintenance.html break; | |
} | |
# This is a normal 503 so serve that page. | |
rewrite ^(.*)$ /503.html break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment