1. 去掉地址中的/api部分
location /api/ws{
rewrite "^/api(.*)$" $1;
}
2. /ws地址将转发http://47.119.131.185
location /ws {
proxy_pass http://47.119.131.185;
}
3. 转换/api/interface为/interface并转发到https://siwei.me
location /api/interface{
rewrite "^/api(.*)$" $1;
}
location /interface{
proxy_pass http://siwei.me;
}
要测试上面的修改 nginx -t
要使用上面的修改生效 nginx -s reload