user  www www;
worker_processes  2;
 
#error_log  logs/error.log;
error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
 
pid        logs/nginx.pid;
 
worker_rlimit_nofile 2048;
 
events {
    use epoll;
    worker_connections  2048;
}
 
http {
    include       mime.types;
    default_type  application/octet-stream;
 
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
 
    #access_log  logs/access.log  main;
 
    tcp_nopush     on;
 
    #keepalive_timeout  0;
    keepalive_timeout  180;
 
    server_tokens off;
 
    ## Compression
    gzip  on;
    gzip_min_length 1024;
    gzip_comp_level    6;
    gzip_buffers    16 8k;
    gzip_types    text/plain application/x-javascript text/css;
    gzip_proxied any;
    gzip_http_version 1.0;
 
    #upload max size
    client_max_body_size 10M;
    client_body_buffer_size 1024K;
 
    #
    client_header_buffer_size 8K;
    large_client_header_buffers 4 8K;
 
    #
    fastcgi_intercept_errors on;
    fastcgi_buffers 8 128k;
	
 
   server {
        listen 80;
        server_name  _;

        set $host_dir /opt/web/php/;
        charset utf-8;
        access_log  logs/access.log;

        location / {
                root    $host_dir;
                index   index.php index.html index.htm;
        }

        location ~ \.php {
                root           $host_dir;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $host_dir$fastcgi_script_name;
                include        fastcgi_params;
        }

        #location ~ /\.ht {
        #    deny  all;
        #}
    }

}
