nginx reverse proxy path matching rules Notes

"/"problem

Access www.xxxx.com/api
Configuration 1: proxy_pass without end /

location /api/ {
proxy_pass http://localhost:8080;
}

The actual visit is:

www.xxxx.com/api

Configuration 2: proxy_pass end add /

LOCATION / API / {
proxy_pass HTTP: // localhost: 8080 /;
}
actually accessed are:
www.xxxx.com

Summary: plus / without path (api), without / with the path!

Published 11 original articles · won praise 0 · Views 6672

Guess you like

Origin blog.csdn.net/weixin_42267704/article/details/104413019