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; } }
這樣就行了
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; } }
這樣就行了