Nginx重定向规则

时间:2015-09-24 15:31:02

标签: ubuntu nginx webserver

我在Nginx中有以下规则将特定网址重定向到新网址

location /customer/my_info {
  proxy_pass http://example.com/abc;
}

这很好用。我还有另一个网址,我不想重定向但是它被重定向。

/customer/my_info_verify

需要添加什么规则才能重定向完全匹配的网址?

1 个答案:

答案 0 :(得分:0)

使用=修饰符定义URI和位置的完全匹配。如果找到完全匹配,搜索将终止。

location = /customer/my_info {
  proxy_pass http://example.com/abc;
}

来源:http://nginx.org/en/docs/http/ngx_http_core_module.html#location

相关问题