From 974aaa48ff6c67f40d2f708e0deea0027ab73485 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 19 Feb 2024 09:45:13 -0800 Subject: [PATCH] Add maintenance.html page --- deploy/files/sites-available/impress.conf | 11 +++++ public/maintenance.html | 56 +++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 public/maintenance.html diff --git a/deploy/files/sites-available/impress.conf b/deploy/files/sites-available/impress.conf index c889818a..1085bf66 100644 --- a/deploy/files/sites-available/impress.conf +++ b/deploy/files/sites-available/impress.conf @@ -8,6 +8,8 @@ server { } server { + set $maintenance 0; # To enable maintenance mode, set this to 1. + server_name {{ impress_hostname }}; listen 443 ssl; listen [::]:443 ssl; @@ -31,10 +33,19 @@ server { add_header ETag ""; } + # On status 503, return the maintenance page. + error_page 503 maintenance.html; + # Try serving static files first. If not found, fall back to the app. try_files $uri/index.html $uri @app; location @app { + # If we're hardcoded as being in maintenance mode, return status 503, which + # will show the maintenance page as specified above. + if ($maintenance = 1) { + return 503; + } + proxy_pass http://127.0.0.1:3000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/public/maintenance.html b/public/maintenance.html new file mode 100644 index 00000000..e656a9d2 --- /dev/null +++ b/public/maintenance.html @@ -0,0 +1,56 @@ + + + + + + Dress to Impress: Maintenance Time! + + + +
+ Distressed Grundo programmer +
+

DTI is down for maintenance!

+

+ We're working on something for the moment, sorry for the + trouble! +

+

We're doing our best to be back up soon! 💖

+
+
+ +