Merge branch 'feature/maintenance_page' of kosmos/chef into master
This commit is contained in:
commit
afc9a6da43
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
40
site-cookbooks/kosmos-nginx/files/default/maintenance.html
Normal file
40
site-cookbooks/kosmos-nginx/files/default/maintenance.html
Normal file
File diff suppressed because one or more lines are too long
@ -60,6 +60,22 @@ cookbook_file "#{node['nginx']['dir']}/conf.d/tls_config.conf" do
|
||||
notifies :restart, 'service[nginx]'
|
||||
end
|
||||
|
||||
directory node["nginx"]["user_home"] do
|
||||
owner node["nginx"]["user"]
|
||||
group node["nginx"]["group"]
|
||||
action :create
|
||||
recursive true
|
||||
end
|
||||
|
||||
# Maintenance page, to be copied or served when putting things in maintenance
|
||||
# mode
|
||||
cookbook_file "#{node["nginx"]["user_home"]}/maintenance.html" do
|
||||
source "maintenance.html"
|
||||
owner node['nginx']['user']
|
||||
group node['nginx']['group']
|
||||
mode "0640"
|
||||
end
|
||||
|
||||
unless node.chef_environment == "development"
|
||||
include_recipe 'kosmos-base::firewall'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user