心 涯

NET&JAVA&PHP(要跨界,你不只要跨「脑」的界限,更要跨越「心」的界限,不怕改变,不怕再学习!)

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

user  www www;

worker_processes 10;

error_log  /data1/logs/nginx_error.log  crit;

#pid        logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
{
       use epoll;

       worker_connections 51200;
}

http
{
       include       conf/mime.types;
       default_type  application/octet-stream;

       charset  utf-8;
      
       server_names_hash_bucket_size 128;
      
       #sendfile on;
       #tcp_nopush     on;

       keepalive_timeout 60;

       tcp_nodelay on;

       gzip on;
       gzip_min_length  1k;
       gzip_buffers     4 8k;
       gzip_http_version 1.1;
       gzip_types       text/plain application/x-javascript text/css text/html application/xml;

       server
       {
               listen       80;
               server_name localhost.sample.com;
               index index.html index.htm index.php;
               root  /var/local/htdocs;

               #if (-d $request_filename)
               #{
               #       rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
               #}
               location /shlevod {
   index index.php;
    #配置开始
          if (!-f $request_filename)
   {
    rewrite ^/(.+)$ /shlevod/index.php?$1 last;
   }
  }
  location ~* ^.+\.(js|ico|gif|jpg|jpeg|pdf|png|css)$ {
            access_log   off;
            expires      7d;
  }

#配置结束
               location ~ .*\.php?$
               {
                    include conf/fcgi.conf;     
                    fastcgi_pass  127.0.0.1:8099;
                    fastcgi_index index.php;
               }

               log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
                                     '$status $body_bytes_sent "$http_referer" '
                                     '"$http_user_agent" $http_x_forwarded_for';
               access_log  /data1/logs/access.log  access;
       }

       #server
       #{
        #       listen  80;
         #      server_name  status.blog.s135.com;

          #     location / {
           #         stub_status on;
            #        access_log   off;
             #  }
      # }
}

posted on 2010-03-04 16:58  witer666  阅读(896)  评论(0编辑  收藏  举报