【问题标题】:Run secondcrack in a nginx server在 nginx 服务器中运行 secondcrack
【发布时间】:2013-05-31 12:50:47
【问题描述】:

我正在尝试运行secondcrack,这是 nginx 服务器中的静态文件 Markdown 博客引擎的 php 解决方案(原始文件仅在 Apache 中测试过)。那么有人知道如何将这个 Apache 的 .htaccess 转换为 nginx 语法吗?

Options -MultiViews

AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/xml text/rss text/rss+xml

RewriteEngine On

RewriteRule ^([^\.]*)$ - [T=text/html]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [QSA,L]

ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

【问题讨论】:

    标签: php .htaccess nginx


    【解决方案1】:

    我们开始:

    index index.html
    location ~ ^/your_blog_location/. {
        default_type text/html;
        try_files $uri $uri.html;
        error_page    404 = /404.html;
        error_page 500 502 503 504 = /500.html;
    }
    

    (别忘了 --> 完成后重启 nginx)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多