Development environment
CodeIgniter 2.14
PHP 5.4.18
Nginx 1.4.2
CodeIgniter Configuration
The config.php file that opens Codeignite is modified as follows:
$config [' uri_protocol '] = "path_info";
Nginx Configuration
Open the Nginx profile nginx.conf file and modify it as follows:
# I am using the virtual host configuration
server {
listen ;
server_name dev.example.com;
Rewrite_log on;
root/www/web/htdocs/dev.example.com;
Index index.php index.html index.htm;
Location/{
index index.php index.html index.htm;
}
Location ~ \.php ($|/) {
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 ^/(. *) $/index.php/$1 last;
break;
Location ~/\.ht {
deny all;
}
}
You can now access it in PathInfo mode, such as:
Http://dev.example.com/app/welcome/test