【问题标题】:Simple .htaccess to nginx简单的 .htaccess 到 nginx
【发布时间】:2011-07-14 11:15:28
【问题描述】:

我需要帮助如何将这个简单的 .htaccess 转换为 ngingx 格式,我真的不知道从哪里开始。我试图浏览 nginx 文档,但它们让我不知所措,我现在需要完成,所以请帮忙:)


   RewriteEngine on
   RewriteRule    ^$ app/host/    [L]
   RewriteRule    (.*) app/host/$1 [L]

【问题讨论】:

    标签: mod-rewrite apache2 nginx


    【解决方案1】:

    rewrite  (.*)  /app/host$1;
    

    在你的server { .. }

    【讨论】:

    • 它似乎不起作用,因为它没有将 $1 传递给应用程序,只是寻找 /app/host/whatever/was/my/nice/link
    • app/host/$1 看起来像你需要的。你能给我更多的例子吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-11
    • 2017-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-06
    • 2011-03-14
    相关资源
    最近更新 更多