Skip to content

Instantly share code, notes, and snippets.

@neesonqk
Forked from rictorres/maintenance-mode.conf
Created November 13, 2016 07:26
Show Gist options
  • Save neesonqk/aa09d5b3c621549856276d18f865b697 to your computer and use it in GitHub Desktop.
Save neesonqk/aa09d5b3c621549856276d18f865b697 to your computer and use it in GitHub Desktop.
nginx maintenance mode
server {
listen 80;
server_name mysite.com;
root /var/www/mysite.com/;
location / {
if (-f $document_root/maintenance.html) {
return 503;
}
... # the rest of your config goes here
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment