1. Platform: Lnmp CentOS6.4 (64bit) nginx1.2.4+php5.5.7 configuration process encountered problems and processing methods:
1.404 Error:
Cause: An issue with the configuration request path in Nginx
2.405 Error: An error occurred during the post to static file of Nginx.
Log_format Ci3_main'$remote _addr-$remote _user [$time _local] "$request"' '$status $body _bytes_sent "$http _referer"' '"$http _user_agent" "$http _x_forwarded_for "'; server {Listen8089; server_name www.ainux.com; #charset Koi8-R; Access_log logs/ www. Ainux.com.log ci3_main; Location/{root/data/Ci3; Index index.php index.html index.htm; Error_page405= $$uri; } error_page404/404. html; # REDIRECT Server error pages to the static page/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root html; } # Proxy The PHP scripts to Apache listening on127.0.0.1: the# #location~\.php$ {# Proxy_pass http://127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# Location~\.php {Root/data/ci;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename/data/ci/$fastcgi _script_name;
include Fastcgi_params;}
Location ~ ^/nginxstatus/{
Stub_status on;
Access_log off;
}
# Deny access to. htaccess files, if Apache ' s document Root
# concurs with Nginx ' s one
#
Location ~/\.ht {
Deny all;
}
}
The configured content after the resolution is:
Log_format Ci3_main'$remote _addr-$remote _user [$time _local] "$request"' '$status $body _bytes_sent "$http _referer"' '"$http _user_agent" "$http _x_forwarded_for "'; server {Listen8089; server_name www.ainux.com; #charset Koi8-R; Access_log logs/ www. Ainux.com.log ci3_main; Location/{root/data/Ci3; Index index.php index.html index.htm; error_page 405 =200 $uri;//fix 405 error here, error in post static file } error_page404/404. html; # REDIRECT Server error pages to the static page/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root html; } # Proxy The PHP scripts to Apache listening on127.0.0.1: the# #location~\.php$ {# Proxy_pass http://127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# Location~\.php { root /data/ci3; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename/data/ci3/$fastcgi _script_name; Include Fastcgi_params; Fastcgi_split_path_info ^ (. +\.php) (. *)$; Fastcgi_param path_info $fastcgi _path_info; }
Location ~ ^/nginxstatus/{
Stub_status on;
Access_log off;
}
# Deny access to. htaccess files, if Apache ' s document Root
# concurs with Nginx ' s one
#
Location ~/\.ht {
Deny all;
}
}
The deployment and practice of CI in CentOS lnmp