【发布时间】:2012-07-14 04:45:11
【问题描述】:
我在使用 nginx“位置”指令和正则表达式时遇到问题。
我想让一个位置与以“/user-profile”开头的 url 匹配。
问题是 nginx 不匹配,但是如果我更改配置并尝试使用 userprofile(即没有连字符),它就像一个魅力。
我认为存在与正则表达式相关的问题,但无法解决。
我目前的配置是:
location ^~ /user-profile {
proxy_pass http://remotesites;
}
我也尝试过:
location ^~ /user\-profile {
proxy_pass http://remotesites;
}
感谢您能给我的任何帮助。
谢谢!
【问题讨论】:
-
location ^~ /user-profile本身工作正常,您的问题是由您的 nginx 配置的其他部分或上游引起的。
标签: nginx