server {
listen 80;
server_name xxxxxxx;
root /xxxxx/public;
index index.php index.html;
access_log /mydata/wwwlogs/access_nginx.log combined;
error_log /mydata/wwwlogs/error_nginx.log;
location ~ \.php {
#root /mydata/htdocs/office;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
#http模式禁用上面的 启用下面这个
#fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
set $path_info "";
set $fastcgi_script_name_new $fastcgi_script_name;
if ($fastcgi_script_name ~* "^(.+\.php)(/.+)$" ) {
set $fastcgi_script_name_new $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name_new;
fastcgi_param SCRIPT_NAME $fastcgi_script_name_new;
fastcgi_param PATH_INFO $path_info;
}
location / {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php$1 last;
}
}
}