Home >Operation and Maintenance >Nginx >What is the difference between nginx location and proxy_pass
Pre-test access domain name: www.test.com/api/upload
location /api/ { proxy_pass http://127.0.0.1:8080/; }
Access address :www.test.com/api/upload-->http://127.0.0.1:8080/upload
location /api { proxy_pass http://127.0.0.1:8080/; }
Access address: www.test.com/api/upload-->http://127.0.0.1:8080//upload
location /api/ { proxy_pass http://127.0.0.1:8080; }
with location. Access address: www.test.com/api/upload-->http://127.0.0.1:8080/api/upload
location /api { proxy_pass http://127.0.0.1:8080; }
Access address: www.test.com/api/upload-->http:/ /127.0.0.1:8080/api/upload
location /api/ { proxy_pass http://127.0.0.1:8080/server/; }
Access address: www.test.com/api/upload-->http: //127.0.0.1:8080/server/upload
location /api { proxy_pass http://127.0.0.1:8080/server/; }
Access address: www.test.com/ api/upload-->http://127.0.0.1:8080/server//upload
location /api/ { proxy_pass http://127.0.0.1:8080/server; }
Access address: www.test.com/api/upload-->http://127.0.0.1:8080/serverupload
location /api { proxy_pass http://127.0.0.1:8080/server; }
Access address: www.test.com/api/upload-->http://127.0.0.1:8080/server/upload
The above is the detailed content of What is the difference between nginx location and proxy_pass. For more information, please follow other related articles on the PHP Chinese website!