In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people don't understand the knowledge points of this article "What is the difference between nginx location and proxy_pass", so Xiaobian summarizes the following contents for everyone. The contents are detailed, the steps are clear, and they have certain reference value. I hope everyone can gain something after reading this article. Let's take a look at this article "What is the difference between nginx location and proxy_pass".
Pre-test access domain: www.test.com/api/upload
1. If location and proxy_pass both have/, then the real address does not have location matching directory location /api/ { proxy_pass http://127.0.0.1:8080/;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/upload
2.location without/, proxy_pass with/, real address with/location /api { proxy_pass http://127.0.0.1:8080/;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080//upload
3.location with/, proxy_pass without/, then the real address will have location matching directory/api/location /api/ { proxy_pass http://127.0.0.1:8080;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/api/upload
4. If neither location nor proxy_pass carries/, the real address will carry location matching directory/api/location /api { proxy_pass http://127.0.0.1:8080;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/api/upload
5. Same as 1, but proxy_pass with address location /api/ { proxy_pass http://127.0.0.1:8080/server/;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/server/upload
6. The same as 2, but proxy_pass with address, then the real address will be multiple/location /api { proxy_pass http://127.0.0.1:8080/server/;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/server//upload
7. The same as 3, but proxy_pass with address, then the real address will be directly linked location /api/ { proxy_pass http://127.0.0.1:8080/server;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/serverupload
8. Same as 4, but proxy_pass has address, then real address matching address will replace location matching directory location /api { proxy_pass http://127.0.0.1:8080/server;}
Visit address: www.test.com/api/upload--> http://127.0.0.1:8080/server/upload
The above is about the content of this article about "what is the difference between nginx location and proxy_pass". I believe everyone has a certain understanding. I hope that the content shared by Xiaobian will be helpful to everyone. If you want to know more relevant knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.