Created
April 3, 2013 14:57
-
-
Save paneq/5301937 to your computer and use it in GitHub Desktop.
nginx maintenance page that is JSON friendly
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
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
internal; | |
if ($http_accept ~ json) { | |
return 503 "{}"; | |
} | |
rewrite ^(.*)$ /system/maintenance.html last; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment