如题所述
å ³äºnginxç伪éæ设置ï¼æ¡ä¾ï¼
server {
listen 80;
server_name localhost;
index index.html index.htm index.php;
root /alidata/www/;
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
# 以ä¸æ¯ä¸ºäºè®©Nginxæ¯æPATH_INFO
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param script_FILENAME $document_root$real_script_name;
fastcgi_param script_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_connect_timeout 120;
fastcgi_send_timeout 120;
fastcgi_read_timeout 120;
fastcgi_buffers 8 128K;
fastcgi_buffer_size 128K;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
#伪éæè§å
access_log /alidata/log/nginx/access/default.log;
}