一、域名IP下所有請求都跳轉到維護頁面
/配置如下:
location / {
root /var/local/xahtml/;#指定文件目錄
index index.html;#實際文件目錄/var/local/xahtml/index.html
}
輸入域名或者IP訪問時,會跳轉到index.html。
輸入/aaa等會報錯404,因此如果掛維護頁面可以進行如下配置
error_page 404 /;#代表轉到域名、IP訪問即上面/的配置下,如此可保證域名下所有都跳轉到同一維護頁面
二、僅系統訪問路徑入口跳轉到維護頁面
location / {
index index.html;#實際文件目錄/var/local/xahtml/index.html
}
location /boss {
proxy_pass http://129.204.45.72/;
}