首页 > 代码库 > PHP CI框架下,如果配置NGINX(根目录和子目录两种模式)
PHP CI框架下,如果配置NGINX(根目录和子目录两种模式)
摸索了一会儿,先配置成功,再看看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; }
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; }
PHP CI框架下,如果配置NGINX(根目录和子目录两种模式)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。