nginx-matrix: add maintenance page

This commit is contained in:
teutat3s 2024-06-22 16:40:42 +02:00
parent 02af5fb8c9
commit 0ccbedc352
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -141,16 +141,22 @@ in
ssl = true; ssl = true;
} }
]; ];
root = "/dev/null"; root = "/srv/nginx";
extraConfig = '' extraConfig = ''
server_tokens off; server_tokens off;
gzip on; gzip on;
gzip_types text/plain application/json; gzip_types text/plain application/json;
''; '';
locations."/maintenance.html" = {
};
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:8008";
extraConfig = '' extraConfig = ''
if (-f $document_root/maintenance.html) {
return 503;
}
error_page 503 /maintenance.html;
proxy_pass http://127.0.0.1:8008;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;