Home | Mirror | Search | ITEYE 博客 | OSChina 博客 | 51CTO 博客 |
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 /etc/nginx/conf.d/www.mydomain.com.conf:25 nginx: configuration file /etc/nginx/nginx.conf test failed
在location,if中使用證則匹配proxy_pass末尾不能寫/
if ($request_uri ~* "^/info/{cn|tw}/{news|info}/\d\.html") { proxy_pass http://info.example.com/; break; } location ~ ^/info/ { proxy_pass http://info.example.com/; break; }
proxy_pass http://info.example.com/; 改為 proxy_pass http://info.example.com; 可以解決