#cat /data/nginx/conf/conf.d/www.cu.com
server {
listen 80;
server_name www.cu.com;
index index.html index.htm index.php;
root /var/www/www.cu.com;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
# if ($request_filename !~* /(javascript|css|images|fckeditor|userfiles|crontab|robots\.txt|index\.php)) {
# rewrite ^/(.*)$ /index.php?$1 last;
# }
}
location ~ .*.php {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_NAME $real_script_name;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|cs)?$ {
expires 12h;
}
log_format www.cu.com '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /data/logs/www.cu.com.log;
}
阅读(1201) | 评论(1) | 转发(0) |