Configuration of the CodeIgniter:
Worker_processes1; events {Worker_connections1024x768;} HTTP {include mime.types; Default_type Application/octet-stream; Sendfile on; Keepalive_timeout $; Fastcgi_connect_timeout 300s; Fastcgi_send_timeout 300s; Fastcgi_read_timeout 300s; Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8 -fastcgi_busy_buffers_size 256k; Fastcgi_temp_file_write_size 256k; Fastcgi_intercept_errors on; #gzipOn ; server {Listen the; #server_name localhost; Location/{root HTML; Index index.php index.html index.htm; Try_files $uri $uri//index.php? $uri &$args; } Location~\.php$ {include fastcgi_params; root HTML; Fastcgi_pass127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_split_path_info^((? U). +.php) (/?. +)$; Fastcgi_param script_filename $document _root$fastcgi_script_name; Fastcgi_param path_info $fastcgi _path_info; Fastcgi_param path_translated $document _root$fastcgi_path_info; } }}
thinkphp configuration:
Worker_processes1; events {Worker_connections1024x768;} HTTP {include mime.types; Default_type Application/octet-stream; Sendfile on; Keepalive_timeout $; Fastcgi_connect_timeout 300s; Fastcgi_send_timeout 300s; Fastcgi_read_timeout 300s; Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8 -fastcgi_busy_buffers_size 256k; Fastcgi_temp_file_write_size 256k; Fastcgi_intercept_errors on; #gzipOn ; server {Listen the; #server_name localhost; Location/{root HTML; Index index.php index.html index.htm; #try_files $uri $uri//index.php? $uri &$args; if(!-e $request _filename) {Rewrite^ (. *) $/index.php?s=$1 Last; Break }} Location~\.php$ {#include fastcgi_params; Include fastcgi.conf; root HTML; Fastcgi_pass127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_split_path_info^ (. +\.php) (/.*)$; Fastcgi_param path_info $fastcgi _path_info; } }}
Laravel configuration:
Worker_processes1; events {Worker_connections1024x768;} HTTP {include mime.types; Default_type Application/octet-stream; Sendfile on; Keepalive_timeout $; Fastcgi_connect_timeout 300s; Fastcgi_send_timeout 300s; Fastcgi_read_timeout 300s; Fastcgi_buffer_size 128k; Fastcgi_buffers8128k;#8 -fastcgi_busy_buffers_size 256k; Fastcgi_temp_file_write_size 256k; Fastcgi_intercept_errors on; #gzipOn ; server {Listen the; #server_name localhost; Root/usr/local/nginx/html/Public ; Index index.html index.php; Location/{try_files $uri $uri/ /index.php$is_args$query_string; } Location~\.php$ {try_files $uri=404; Fastcgi_pass127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; } }}
The prerequisite is to start the fpm of PHP (the default port is 9000):
/usr/local/php/sbin/php-fpm-c/usr/local/php/etc/php.ini-y/usr/local/php/etc/php-fpm.conf
[Nginx]-PHP+FPM related configuration