How can i turn on maintenance mode on nginx, I am hosting multiple Angular apps with Nginx. All of them run in their own containers. Maintenance page is located at /var/www/maintenance/. My current config is bellow
server {
listen 80;
listen 443 ssl;
server_name example.eu;
ssl_certificate /etc/letsencrypt/live/example.eu-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.eu-0001/privkey.pem; # managed by Certbot
# user ssl certificate check
ssl_client_certificate /home/user/CA/certs/users/klient.crt;
#ssl_crl /home/user/CA/crl/ca.crl;
ssl_verify_client on;
access_log /var/log/nginx/graylog_access.log;
error_log /var/log/nginx/graylog_error.log;
location /abc/ {
root /var/webapps/;
}
location = / {
proxy_pass http://localhost:5000/abcd;
}
location /abcd {
rewrite ^/abcd(/css/|/js/|/img/)(.*)$ $1$2 break;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_send_timeout 3600;
proxy_read_timeout 3600s;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto "https";
}
location /efgh/ {
rewrite ^/efgh(/css/|/js/|/img/)(.*)$ $1$2 break;
proxy_pass http://localhost:5005;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_send_timeout 3600;
proxy_read_timeout 3600s;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto "https";
}
server {
if ($host = example.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name example.eu;
return 404; # managed by Certbot
}