"proxy_pass" cannot have URI part in location given by regular expression, or inside named location

1. 描述

在named location中proxy_pass转发地址带uri会报错:

nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /usr/local/nginx/conf/nginx.con

意思是proxy_pass 在带正则表达式的location中,命名 location中,if语句中,limit_except 块中不能带URI。


2. 解决方法

uri最后后面加上$args内置变量就可以通过语法检查并且好使。


3.研究

这个问题目前只知其然不知其所以然,先mark下,回头有时间了再研究

你可能感兴趣的:(nginx)