# 東町自治会 # 担当: 七瀬 / 契約開始: 2019-10-01 # メンテナンス中でも本社オフィスからは確認できるようにする geo $maint_bypass_higashimachi { default 0; 198.51.100.20 1; # 本社オフィス } server { listen 443 ssl; server_name higashimachi-jichikai.example www.higashimachi-jichikai.example; ssl_certificate /etc/ssl/minamo/higashimachi.crt; ssl_certificate_key /etc/ssl/minamo/higashimachi.key; access_log /var/log/nginx/higashimachi.access.log; error_log /var/log/nginx/higashimachi.error.log; set $maint ""; if (-f /var/www/higashimachi/MAINTENANCE) { set $maint "on"; } if ($maint_bypass_higashimachi) { set $maint ""; } if ($maint = "on") { return 503; } error_page 503 @maintenance; location @maintenance { root /var/www/_common; rewrite ^ /maintenance.html break; } location / { proxy_pass http://10.0.1.12; # web02 proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; } }