location ^~/api/ {
proxy_pass http://localhost:8080/;
}
经过这样修改后,你的nginx在你使用浏览器访问/api/test后,实际访问的后端服务url就是localhost:8080/test了。
nginx去除访问连接前缀
最新推荐文章于 2024-02-06 09:33:46 发布
location ^~/api/ {
proxy_pass http://localhost:8080/;
}
经过这样修改后,你的nginx在你使用浏览器访问/api/test后,实际访问的后端服务url就是localhost:8080/test了。