user  nobody;
worker_processes  8;

pid         log/nginx.pid;


events {
    use epoll;
    worker_connections  100000;
}
worker_rlimit_nofile 100000;

http {
    include       mime.types;
    default_type  application/octet-stream;
    server_tokens off;
    menshen_module off;

    types {
        application/javascript js;
    }

    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 8m;

    sendfile          on;
    tcp_nopush        on;
    tcp_nodelay       on;

    keepalive_timeout  0;

    fastcgi_connect_timeout 30;
    fastcgi_send_timeout 30;
    fastcgi_read_timeout 30;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 128k;
    fastcgi_intercept_errors on;

    proxy_connect_timeout 3;
    proxy_read_timeout 3;
    proxy_send_timeout 3;
    proxy_buffer_size 64k;
    proxy_buffers 4 64k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    proxy_temp_path /tmp/temp_dir;
    proxy_cache_path /data/cache levels=1:2 keys_zone=cache_one:100m inactive=1d max_size=5g;

    gzip              on;
    gzip_min_length   1k;
    gzip_buffers      4 16k;
    gzip_http_version 1.0;
    gzip_comp_level   2;
    gzip_types        text/plain text/css text/javascript text/html ;
    gzip_vary         on;

    charset      utf-8;

    access_log   off;
    log_not_found off;

    error_page   400 403 405 408 /40x.html ;
    error_page   500 502 503 504 /50x.html ;

    map $http_x_forwarded_for  $clientRealIp {
                             ""      $remote_addr;
                             ~^(?P<firstAddr>[0-9\.]+),?.*$  $firstAddr;
                    }
    log_format  main  '$clientRealIP - $remote_user [$time_local] "$request" '
                             '$status $body_bytes_sent "$http_referer" '
                            '"$http_user_agent"';

    server{
                listen 80;
                # server_name tdf-devtools.woa.com;
                access_log /usr/local/services/tnginx_1_0_0-1.0/log/access.log main;

                location  /devtools-protocol {
                    root  /data/release/;
                }
        }
}