码迷,mamicode.com
首页 > Web开发 > 详细

PHP CI框架下,如果配置NGINX(根目录和子目录两种模式)

时间:2014-11-11 18:29:59      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   sp   div   on   

摸索了一会儿,先配置成功,再看看PATH_INFO之类的东东吧。

A,根目录:

location ~ \.php($|/) {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

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

bubuko.com,布布扣

B,子目录:

location /CI/ {
            if (!-e $request_filename) {
                rewrite ^/CI/(.*)$ /CI/index.php/$1 last;
                break;
            }
         }
        location /CI/index.php {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

bubuko.com,布布扣

 

PHP CI框架下,如果配置NGINX(根目录和子目录两种模式)

标签:style   blog   http   io   color   ar   sp   div   on   

原文地址:http://www.cnblogs.com/aguncn/p/4089708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!