user  daemon daemon;
worker_processes  4;

error_log  logs/error.log ;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        logs/nginx.pid;


events {
        use epoll;
    worker_connections  1024;
}


http {
        proxy_cache_path  /home2/cache2  levels=1:2    keys_zone=STATIC:1000m
                                         inactive=13h  max_size=20g;

        #resolver 8.8.8.8;
    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;
        access_log off;

        server_tokens   off;
    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

        index   index.php       index.htm       index.html ;
        server_name_in_redirect off;
        client_header_timeout  10m;
        client_body_timeout    10m;
        send_timeout           10m;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout  30000;
        fastcgi_read_timeout 300;
        client_max_body_size 50m;
        client_header_buffer_size    1k;
        large_client_header_buffers  4 4k;

        gzip on;
        gzip_min_length  1100;
        gzip_buffers     4 8k;
        gzip_types       text/plain;

        output_buffers   1 32k;
        postpone_output  1460;

    server {
        listen 8080; 
        #access_log off;
        server_name 61.74.61.23 122.227.135.135;
        root /home2/wwwdata/default;
	access_log  logs/default.log  main;
	error_page  404 http://www.zhaokunyao.com;
     
    }
    
    server {
        #main.
        listen       8080;
        server_name  www.ads119.com;
        charset utf-8;
        access_log off;
	error_log  logs/ttttt debug_http;
        location  / {
                proxy_pass http://www.ads119.com;
                proxy_set_header        Host $host:8080;
                proxy_set_header        X-Real-IP  $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_cache STATIC;
		#proxy_cache_key  $proxy_host$request_uri;
                proxy_cache_valid       200 3h;
                proxy_cache_use_stale   error timeout invalid_header updating
                                        http_500 http_502 http_503 http_504;
        }

        location ~ /\.ht {
            deny  all;
        }

        if ( $fastcgi_script_name ~ \..*\/.*php ) {
                return 403;
        }
    }

}
