iT邦幫忙

0

nginx rewrite+proxy_pass 後的 404 轉跳

目的是不要設定 root 目錄 !!!
想要瀏覽 http://haha.vip 時候會跳到 http://g.gang.com/zzz/tgt.html
這部分已做出來了

server {
        listen 80;
        server_name haha.vip;

        charset utf-8;
        access_log  /home/wwwlogs/haha.vip.access.log;
        location = / {
            rewrite ^ /zzz/tgt.html permanent;
        }
        location / {
            proxy_pass http://g.gang.com:80;
        }
}

但是想要 404 時會轉跳到 http://g.gang.com/zzz/tgt.html
http://g.gang.com/ 這個 nginx 沒有設定 404 的狀況下 .....

例如
http://haha.vip/test.html 這樣會 404
然後 404 的 Error page 是 http://g.gang.com/zzz/tgt.html
http://g.gang.com 那邊 nginx 沒有設定 404 error page 狀況下

一直設定不出來
有沒有知道哪個方式可以 ... (不要設定 root 路徑 , 設定了就失去 proxy_pass 的意義了)

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答