加入收藏 | 设为首页 | 会员中心 | 我要投稿 商洛站长网 (https://www.0914zz.com/)- AI应用、CDN、边缘计算、云计算、物联网!
当前位置: 首页 > 运营中心 > Nginx > 正文

NGINX / Apache RewriteMap

发布时间:2021-02-21 08:04:33 所属栏目:Nginx 来源:互联网
导读:我想知道如何在NGINX中翻译Apache“ RewriteMap”指令.我在NGINX在线文档中什么都没找到我当前的apache代码是:RewriteMap map-one txt:C:/map-one.txt RewriteMap map-two txt:C:/map-two.txt Directory / Options A

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

任何想法 ? 最佳答案 检查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/;
}

(编辑:商洛站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读