When the nginx user enters aaa.com/xyz, the page opened is the bbb.com/xyz page.
迷茫
迷茫 2017-05-16 17:25:35
0
1
869

There is no xyz directory on my website. After entering xyz, I access the xyz directory of another website, but the domain name on the browser is still my domain name. Can it be set in nginx? Thanks

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
过去多啦不再A梦
server {  
    listen 80;
    server_name     aaa.com;  
    # 下面这个就是路径代理了
    location ^~ /xyz/ {  
            proxy_pass http://xxx.com;  
            proxy_redirect off;  
    }  

    location ^~ / {  
            root   /var/www/xxxx;  
            index  index.html;  
    }  
   } 
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!