场景是用 Nodejs 做 SSR 渲染,服务是 7001 端口,希望客户端访问 https://myaliyun/aaa/xxx 代理到本机的 Nodejs 服务,对于 Nodejs 接收到的请求路径是 /bbb/xxx。
场景是用 Nodejs 做 SSR 渲染,服务是 7001 端口,希望客户端访问 https://myaliyun/aaa/xxx 代理到本机的 Nodejs 服务,对于 Nodejs 接收到的请求路径是 /bbb/xxx。
2 回答951 阅读
1 回答722 阅读✓ 已解决
1 回答604 阅读
650 阅读
nginx 代理的
proxy_pass
指令根据以下情况,有不同的结果:proxy_pass 后带的是 URI,如
http://localhost/resource
(即协议+主机名+资源)这样的内容,将会截取 location 匹配的内容后,添加至代理位置后,例如:匹配
http://domain/hello/world
时,转发至代理时将会变成http://localhost/resource/world
所以,你的proxy_pass 应该为