server {
listen 80;
root /app;
location / {
index index.html;
}
location /api/users {
proxy_pass http://server1-srv:3000/;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /api/chats {
proxy_pass http://server1-srv:4000/;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
请求在 localhost/api/users 工作正常,它正在访问 proxy_pass 服务器 http://server1-srv/3000/ 在 /路线
我想要的是:-