【问题标题】:NGINX / Apache RewriteMapNGINX / Apache RewriteMap
【发布时间】:2013-07-06 19:23:14
【问题描述】:

我想知道如何在 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> 

有什么想法吗?

【问题讨论】:

    标签: apache nginx rewritemap


    【解决方案1】:

    查看Nginx HTTP Map Module

    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/;
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-03
    • 2018-09-30
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    • 2010-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多