nginx + tomcat 架構中,頁面跳轉,URL不變,網頁內容變

Nginx跳轉,URL不變,網頁內容變,這個也還是蠻有意思的

假如,當我們訪問www.abc.com時,頁面內容要跳轉成爲www.abc.com/a/b/c/1.html

 server {
        listen 80;
        server_name www.abc.com;
        location =/ {
                rewrite ^/$  /a/b/c/1.html break;
                proxy_set_header Host $host;
                proxy_pass http://tomcat;
        }
        }

這樣就行了

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