小编yan*_*ang的帖子

nginx 重写:任何 UTF8 字符的符号

我想知道我可以使用什么符号来引用 utf8 编码表中的任何字符以进行 nginx 重写。我试过了:

rewrite ^/.$ /new-location.html break;
Run Code Online (Sandbox Code Playgroud)

但似乎是“。” 只能代表 ascii 字符,当我尝试http://example.com /? (一个汉字),它没有用。

这也不起作用:

rewrite ^/([\x00-\xff])$ /new-location.html break;
Run Code Online (Sandbox Code Playgroud)

regex web-services nginx url-rewriting

3
推荐指数
1
解决办法
4425
查看次数

标签 统计

nginx ×1

regex ×1

url-rewriting ×1

web-services ×1