nginx教程
nginx教程
中文
proxy_pass
一般配置如下:
location ~* \.(jsp|do)$
{
index.html index.html;
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
}
说明:因为location 使用了正则表达式(.(jsp|do)$),而且proxy_pass中包含了URI part(shop_goods).错误提示的意思是:如果location包含了正则表达式,则 “proxy_pass”不能包含URI part(shop_goods).找到原因后,
注意:proxy_pass的值后面不要有斜杠,下面的是错误的:
proxy_pass http://localhost:8080/;
参见: https://blog.csdn.net/mengzuchao/article/details/82591563
更好的文章: https://segmentfault.com/a/1190000018933857?utm_source=tag-newest