nginx location proxy_pass url的/问题
url的/问题在nginx中配置proxy_pass时,当在后面的url加上了/,相当于是绝对根路径,则nginx不会把location中匹配的路径部分代理走;如果没有/,则会把匹配的路径部分也给代理走。下面四种情况分别用http://192.168.1.4/proxy/test.html 进行访问。第一种:location /proxy/ {proxy_pass http://127.0.0.1:81/;}会被代理到http://127.0.0.1:81/test.html 这个url第二
原创
2020-08-14 00:12:23 ·
266 阅读 ·
0 评论