我喜欢做的是代理来自http://example.com/proxy/foo
到的请求http://localhost:8060/foo
此配置代理http://example.com/proxy/foo
到http://localhost:8060/proxy/foo
server {
server_name example.com;
location /proxy/ {
proxy_pass http://localhost:8060;
}
location / {
proxy_pass http://localhost:8040;
}
}
Run Code Online (Sandbox Code Playgroud)