【问题标题】:new to NGINX how do I use htaccess equivalent?NGINX 新手如何使用等效的 htaccess?
【发布时间】:2015-12-16 02:43:14
【问题描述】:

我使用在线转换器尝试将我的 htaccess for pyrocms 转换为 nginx 可读的内容,因为我不断收到 404 错误。

转换器给了我这个:

    # nginx configuration
location ~ 403 {
rewrite ^(.*)$ ^/.*/(system/cms/cache|system/codeigniter|system/cms/config|system/cms/logs|\.git|\.hg).*$ redirect;
}
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php/$1 break;
}
rewrite ^(.*)$ /index.php?/$1 break;
}

我需要在哪里将它添加到我的文件系统中? Debian 操作系统

【问题讨论】:

    标签: .htaccess nginx debian http-status-code-404


    【解决方案1】:

    在 debian 上,您的 nginx 服务器配置文件位于 /etc/nginx/sites-available/ 默认情况下,您应该有一个 /etc/nginx/sites-available/default 对应于默认配置。 你应该阅读 nginx 文档:http://nginx.org/en/docs/http/ngx_http_rewrite_module.html

    【讨论】:

      猜你喜欢
      • 2018-06-13
      • 2016-07-09
      • 2012-02-02
      • 1970-01-01
      • 2015-12-08
      • 2017-10-15
      • 2016-06-16
      • 2018-06-25
      • 2012-12-26
      相关资源
      最近更新 更多