Nginx 反向代理碰到的问题

来源:互联网 发布:网络棋牌游戏代理 编辑:程序博客网 时间:2024/05/19 01:33

http://192.168.16.105/services/total/car_sum

我要用上面那个地址代理下面那个地址

http://192.168.16.105:9898/impala/rest/impala1

配置开始 开始为:

location ~ ^/services/total/car_sum{
proxy_pass http://192.168.16.105:9898/impala/rest/impala1;
}

用了匹配之后  重新启动nginx 启动报错

nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular ex
pression, or inside named location, or inside "if" statement, or inside "limit_e
xcept" block in D:\job_ruanjian\nginx-1.5.8/conf/nginx.conf:20

网上看人有说 在

proxy_pass http://192.168.16.105:9898/impala/rest/impala1后面加上$request_uri

proxy_pass http://192.168.16.105:9898/impala/rest/impala1$request_uri

改成这样启动是没问题了  但是还是代理不了

问题出现 location使用了匹配

如果改成像下面一个 就能正常代理

location /services/total/car_sum{
proxy_pass http://192.168.16.105:9898/impala/rest/impala1;
}


0 0
原创粉丝点击