Skip to content

Instantly share code, notes, and snippets.

@paneq
Created April 3, 2013 14:57
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paneq/5301937 to your computer and use it in GitHub Desktop.
Save paneq/5301937 to your computer and use it in GitHub Desktop.
nginx maintenance page that is JSON friendly
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