+
+
Back soon
++ This website is currently down for maintenance. +
+ +diff --git a/site-cookbooks/kosmos-mastodon/templates/default/nginx_conf_mastodon.erb b/site-cookbooks/kosmos-mastodon/templates/default/nginx_conf_mastodon.erb index 297c858..895a81b 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/nginx_conf_mastodon.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/nginx_conf_mastodon.erb @@ -35,6 +35,11 @@ server { add_header Strict-Transport-Security "max-age=31536000"; location / { + # If the maintenance file is present, show maintenance page + if (-f <%= @mastodon_path %>/public/maintenance.html) { + return 503; + } + try_files $uri @proxy; } @@ -83,5 +88,11 @@ server { tcp_nodelay on; } - error_page 500 501 502 503 504 /500.html; + error_page 500 501 502 504 /500.html; + error_page 503 /maintenance.html; + + location = /maintenance.html { + root <%= @mastodon_path %>/public; + } + } diff --git a/site-cookbooks/kosmos-nginx/files/default/maintenance.html b/site-cookbooks/kosmos-nginx/files/default/maintenance.html new file mode 100644 index 0000000..1ef576c --- /dev/null +++ b/site-cookbooks/kosmos-nginx/files/default/maintenance.html @@ -0,0 +1,40 @@ + + +
+
+
+
+ This website is currently down for maintenance. +
+ +