ciicy 发表于 2018-1-18 21:17:04

我该如何修改nginx.conf使得可以适配使用CI框架?

本帖最后由 ciicy 于 2018-1-18 21:17 编辑

运行环境:centos 7.2
如下是现在已经写好的配置文件内容,但是只能访问默认控制器welcome的index方法,其他的一律都无法访问。内容如下(直接放代码会格式混乱,所以我就写到了文档里,见附件)。

webqd 发表于 2018-1-24 16:19:30

-------- nginx.conf 配置例子如下: -----------------------------------------

                location / {
                  root   html/xxx;
                  indexindex.php index.html index.htm;

                        if (!-e $request_filename) {
                          rewrite ^/(.*)$ /index.php?$1 last;
                          break;
                        }   
               }


-------- .htaccess 文件内容(web根目录下): -----------------------------------------

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1
</IfModule>
页: [1]
查看完整版本: 我该如何修改nginx.conf使得可以适配使用CI框架?