1.rewrite使用break结,使用last会对server标签重新发起请求
location /a/ {
rewrite ^/a/(.*)$ /b/$1 break;
proxy_pass https://www.haiyun.me;
}2.proxy_pass结尾添加/会丢弃路径目录,如下访问/a/test.html会代理到/test.html
location /a/ {
rewrite ^/a/(.*)$ /b/$1 break;
proxy_pass https://www.haiyun.me/;
}3.代理访问重定向的网址:
proxy_redirect https://www.haiyun.me/ http://$host/; 标签:none