前置测试访问域名:www.test.com/api/upload
location /api/ { proxy_pass http://127.0.0.1:8080/; }
访问地址:www.test.com/api/upload-->http://127.0.0.1:8080/upload
location /api { proxy_pass http://127.0.0.1:8080/; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080//upload
location /api/ { proxy_pass http://127.0.0.1:8080; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/api/upload
location /api { proxy_pass http://127.0.0.1:8080; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/api/upload
location /api/ { proxy_pass http://127.0.0.1:8080/server/; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/server/upload
location /api { proxy_pass http://127.0.0.1:8080/server/; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/server//upload
location /api/ { proxy_pass http://127.0.0.1:8080/server; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/serverupload
location /api { proxy_pass http://127.0.0.1:8080/server; }
访问地址: www.test.com/api/upload-->http://127.0.0.1:8080/server/upload
以上是nginx location和proxy_pass的区别是什么的详细内容。更多信息请关注PHP中文网其他相关文章!