|
发表于 2012-2-17 10:22:01
|
显示全部楼层
server
{
listen 80;
server_name 网站域名;
index index.html index.htm index.php;
root /usr/local/web/pr/;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
if ($request_filename !~* /(js|skin|upload|style|ls|img|css|images|fckeditor|userfiles|crontab|robots\.txt|index\.php|system\.php)) {
rewrite ^/(.*)$ /index.php?$1 last;
}
if ($request_filename ~* /(system\.php)) {
rewrite ^/(.*)$ /system.php?$1 last;
}
if ($request_filename ~* /(system\.php)) {
rewrite ^/(.*)$ /webscan_360_cn.html?$1 last;
}
location ~ \.php {
set $real_script_name $fastcgi_script_name;
set $path_info "";
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_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
} |
|