也许是一个愚蠢的问题,但是我似乎找不到很好的文档或示例...
当您使用位置块来过滤传入的请求时,您是从匹配的位置还是从请求的开始进行重写?
一个例子:
location ^~ /category/ {
rewrite ^/category/paid-search-news/?$ /tag/paid-search permanent; # this,
rewrite ^paid-search-news/?$ /tag/paid-search permanent; # this,
rewrite paid-search-news/?$ /tag/paid-search permanent; # or this?
}