筆記一下:配置nginx輸入任何地址都跳轉至維護頁面

筆記一下:配置nginx輸入任何地址都跳轉至維護頁面


server {
    listen 80;
    root /xxx/xxx/src;
    index index.html index.htm;

    server_name test.xxx.com;

    set $flag 0;
      if ($request_uri !~ "(/static/.*)$"){
          set $flag "${flag}1";
      }
      if ($request_uri !~ "/502.html$" ){
          set $flag "${flag}2";
      }
      if ($flag = "012") {
         rewrite ^(.*) http://test.xxx.com/502.html permanent;
      }

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