Skip to content

Instantly share code, notes, and snippets.

@myobie
Forked from anonymous/nginx.conf
Created December 31, 2012 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myobie/4422062 to your computer and use it in GitHub Desktop.
Save myobie/4422062 to your computer and use it in GitHub Desktop.
# ...
location @app {
# ...
if (-f $document_root/system/maintenance.html) {
return 503;
}
# proxy_pass ...
}
error_page 503 @503;
location @503 {
# intercept 405's so we capture POSTs
error_page 405 = /system/maintenance.html;
# only use maintenance if it's there
if (-f $document_root/system/maintenance.html) {
rewrite ^(.*)$ /system/maintenance.html break;
}
# else use the regular 500
rewrite ^(.*)$ /500.html break;
}
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment