Nginx supports php ci framework
1. Find the configuration file modification for the CI Library
$ Config ['base _ url'] = 'HTTP: // test.example.com ';
$ Config ['uri _ Protocol'] = 'path _ info ';
2. Find NGINX configuration. Add the following code segment to the SERVER segment:
Location/index. php {
Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_param SCRIPT_FILENAME/home/wwwroot/index. php;
Fastcgi_param PATH_INFO $ fastcgi_path_info;
Fastcgi_split_path_info ^ (. + \. php) (. *) $;
Fastcgi_param PATH_TRANSLATED $ document_root $ fastcgi_path_info;
Fcinclude gi. conf;
}
3. If you want to perform a jump, (for example, http://test.example.com/index.php/test)
Http://test.example.com/test.) You can add the following configuration in the server segment:
Location /{
If (-f $ request_filename ){
Expires max;
Break;
}
If (! -E $ request_filename ){
Rewrite ^/(. *) $/index. php/$1 last;
}
}
Recommended reading:
Configure and optimize reverse proxy and load balancing in Nginx
Nginx load balancing: nginx: [emerg] cocould not build the types_hash
Nginx Load Balancing module ngx_http_upstream_module details
Nginx + Firebug allows the browser to tell you which Server Load balancer distributes requests
Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)
Nginx details: click here
Nginx: click here