我想知道如何在 NGINX 中翻译 Apache“RewriteMap”指令。
我在 NGINX 在线文档中找不到任何内容
我当前的 apache 代码是:
RewriteMap map-one txt:C:/map-one.txt
RewriteMap map-two txt:C:/map-two.txt
<Directory />
Options All
AllowOverride All
RewriteEngine On
RewriteRule /MYSITE/PRODUCT/([A-Za-z0-9-]+)/([A-Za-z0-9-]+),([0-9]+).aspx /$1/$2/${map-two:$3}/${map-one:$3} [R=301,L]
</Directory>
有什么想法吗?
最佳答案
map $uri $new {
default http://www.domain.com/home/;
/aa http://aa.domain.com/;
/bb http://bb.domain.com/;
/john http://my.domain.com/users/john/;
}
关于apache - NGINX/Apache 重写映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17543958/