In nginx
the configuration of proxy_pass
the agent forwards:
- In
proxy_pass
the back of theurl
increase/
, in absolute root path. - In
proxy_pass
the latterurl
without/
indicating relative paths, path matching portion will also go to the proxy.
Assuming that access address is:http://localhost:8081/test/abc.html
-
Plus
/
:location /test/ { proxy_pass http://127.0.0.1:8081/; }
Actual visit
url
:http://127.0.0.1:8081/abc.html
-
Without
/
:location /test/ { proxy_pass http://127.0.0.1:8081; }
Actual visit
url
:http://127.0.0.1:8081/test/abc.html