【发布时间】:2018-07-11 21:02:20
【问题描述】:
假设我有 example.com,我想在 / 之后重写任何内容到 root,即 example.com/one/two?whatever=foo 应该回到 example.com
我尝试了以下方法:
location = / {
index index.html;
}
location / {
rewrite ^ / permanent;
}
但这给了我太多重定向错误。我可以使用正则表达式来指定所有允许/不允许的字符,但这会使其太丑/长/复杂。
为什么完全匹配不能区分?
【问题讨论】:
标签: nginx url-rewriting