Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created October 29, 2019 16:09
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 diasjorge/4ae9be092542ae82a6af1895c8b3eedf to your computer and use it in GitHub Desktop.
Save diasjorge/4ae9be092542ae82a6af1895c8b3eedf to your computer and use it in GitHub Desktop.
# Add into server block
# Put maintenance page in /home/ubuntu/maintenance/maintenance.html
# Return a 503 error if the maintenance page exists.
if (-f /home/ubuntu/maintenance/maintenance.html) {
return 503;
}
location @503 {
if (-f $request_filename) {
break;
}
root /home/ubuntu/maintenance/;
rewrite ^(.*)$ /maintenance.html break;
}
error_page 503 @503;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment