nginx在重写规则中将大写字母重写为小写字母

nginx在重写规则中将大写字母重写为小写字母,nginx,url-rewriting,Nginx,Url Rewriting,我想像这样重写url: www.example.com/TeSt/AAA/BBBB------->www.example.com/TeSt/AAA/BBB 我这样做,但还没有完成: location /test { proxy_pass http://127.0.0.1:8080; } location ~* /test/ { rewrite .* /test/ last; } Nginx将在前缀location上选择匹配的正则表达式location,除非使用^ ~运算符。有关

我想像这样重写url: www.example.com/TeSt/AAA/BBBB------->www.example.com/TeSt/AAA/BBB

我这样做,但还没有完成:

location /test {
    proxy_pass http://127.0.0.1:8080;
}
location ~* /test/ {
    rewrite .* /test/ last;
}

Nginx将在前缀
location
上选择匹配的正则表达式
location
,除非使用
^ ~
运算符。有关详细信息,请参阅

您的
重写
表达式需要不区分大小写,并且需要捕获URI的其余部分

例如:

location ^~ /test {
    proxy_pass http://127.0.0.1:8080;
}
location ~* /test {
    rewrite (?i)^/test(.*)$ /test$1 last;
}

Nginx将在前缀
location
上选择匹配的正则表达式
location
,除非使用
^ ~
运算符。有关详细信息,请参阅

您的
重写
表达式需要不区分大小写,并且需要捕获URI的其余部分

例如:

location ^~ /test {
    proxy_pass http://127.0.0.1:8080;
}
location ~* /test {
    rewrite (?i)^/test(.*)$ /test$1 last;
}

如果我想重新编写另一条规则-->,我该怎么做?tks.如果我想重新编写另一条规则-->,我该怎么做?tks。