In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces nginx how to configure upstream reverse proxy, the article is very detailed, has a certain reference value, interested friends must read it!
Nginx configure upstream reverse proxy
Http {... Upstream tomcats {server 192.168.106.176 weight=1; server 192.168.106.177 weight=1;} server {location / ops-coffee/ {proxy_pass http://tomcats; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;}
If you don't pay attention, you may fall into the trap of adding proxy_pass bars without adding bars. Here's the difference between proxy_pass http://tomcats and proxy_pass http://tomcats/:
Although it is only one / difference, the result is very different. It is divided into the following two situations:
1. There is no uri (proxy_pass http://tomcats) in the destination address. At this point, in the new target url, the matching uri part remains unchanged and is what it used to be.
Location / ops-coffee/ {proxy_pass http://192.168.106.135:8181;}http://domain/ops-coffee/-- > http://192.168.106.135:8181/ops-coffee/http://domain/ops-coffee/action/abc-- > http://192.168.106.135:8181/ops-coffee/action/abc
two。 The destination address contains uri (proxy_pass http://tomcats/ url / is also uri), and the matching uri part of the new destination url will be modified to the uri in this parameter.
Location / ops-coffee/ {proxy_pass http://192.168.106.135:8181/;}http://domain/ops-coffee/-- > http://192.168.106.135:8181http://domain/ops-coffee/action/abc-- > http://192.168.106.135:8181/action/abc is all the content of this article "how to configure upstream reverse proxy for nginx". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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.