【nginx】掛系統維護頁面

一、域名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/;
        }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章