【发布时间】:2018-06-26 23:50:15
【问题描述】:
我反复阅读nginx proxy_pass docs。我以为我理解了它,直到我花了最后一个小时得到一个没有意义的非描述性错误。其他有同样问题的人似乎与此无关。昨天是我使用 nginx 的第一天。我正在运行 nginx v1.12.2。
当有人请求https://example1.com/just-right/search时,我想将该请求代理到https://example2.com/abc.php
location ~ /just-right/search {
proxy_pass https://example2.com/abc.php;
}
我得到了错误,而不是代理在 proxy_pass 中定义的路径:
"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 line .......
我没有使用正则表达式。 “命名位置”是什么意思?它不在 if 语句或“limit_except”块内,我做错了什么?
【问题讨论】: