1. proxy_pass slash or slash suffix without location at the end

    1. If there is no "/" or "/xx" after proxy_pass, the original string in location is included;
  1. If there is no url path information (such as "/", "/xx") after proxy_pass, the reverse proxy address will include the location part; otherwise, only the remaining paths after matching will be spliced.
 location /online/wxapi/
proxy_pass http://localhost:8080/

Visiting "http://www.x.com/online/wxapi/a.html" will access:

http://localhost:8080/a.html
 location /online/wxapi/
proxy_pass http://localhost:8080

Visit "http://www.x.com/online/wxapi/xx.html" to access

http://localhost:8080/online/wxapi/xx.html

2. Summary:

  • You do not add location when you add "/" to access;
  • When you don't add "/" to access, it will add location to you;

丰木
322 声望19 粉丝

遇见超乎想象的自己!


« 上一篇
有些话
下一篇 »
加解密概要