Chinaunix首页 | 论坛 | 博客
  • 博客访问: 323961
  • 博文数量: 53
  • 博客积分: 1132
  • 博客等级: 少尉
  • 技术积分: 451
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-18 14:22
文章分类

全部博文(53)

文章存档

2014年(1)

2013年(11)

2012年(17)

2011年(16)

2010年(8)

分类: LINUX

2011-02-10 15:18:09

#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;
}
阅读(1158) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-05 13:27:37

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com