【发布时间】:2017-03-16 19:57:44
【问题描述】:
我有一个 URL 中一些过时参数的列表。
arg1
arg2
arg3
...
argn
我需要将链接查询部分中包含任何这些参数的任何请求重定向到特定站点。
/page.html?arg1=sxx&arg2=uuu -> http://xxx.x.xxx.x
/page.php?arg3= -> http://xxx.x.xxx.x
/dir/dir/page/?arg2=111&& argn=xyyyy -> http://xxx.x.xxx.x
/page.html (is not redirected but matched to other existing rules in nginx)
知道如何很好地表达它吗?由于某些原因, location 没有参数可以被正则表达式匹配。
【问题讨论】:
标签: nginx nginx-location