nginx的点API网址住网站nginx的点API网址住网站
位置= http://localhost:5100/services/v1/ { proxy_pass https://test.com/services/v1/; }
nginx的点API网址住网站nginx的点API网址住网站
位置= http://localhost:5100/services/v1/ { proxy_pass https://test.com/services/v1/; }
确保你只在服务器块监听端口5100,以保证重定向只发生在5100
server {
listen 5100;
server_name localhost;
location /services/v1/ {
proxy_pass https://test.com/services/v1/;
}
}
假设你的目的是要向前/服务/ V1/* API请求到test.com, 位置/服务/ V1/ { proxy_pass https://test.com/services/v1/; }
是但只针对端口5100 –
是真实的。想强调不要在位置块中使用=。这是为了确切的URI匹配。 – OneWorld
nginx返回204没有内容 –