user  root;
worker_processes 8;
worker_rlimit_nofile 65535;
#error_log logs/error.log debug; 

#daemon on;
#master_process on; 

#fstack_conf f-stack.conf;

events { 
    use epoll;
    worker_connections  102400;
    #multi_accept on;# test triffic maybe is ussful
    accept_mutex off;
    multi_accept off;
}

worker_rlimit_core 1000m;
working_directory logs/; 

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;    
    access_log off;

    sendfile        off;
    # tcp_nopush     on;// hight transfer mode
    ##tcp_nopush     off;
    ##tcp_nodelay on;

#    keepalive_timeout  0;
    keepalive_timeout  65;
    keepalive_requests 100000;
    # gzip_http_version 1.0;

#    proxy_connect_timeout 75;
#    proxy_send_timeout 200;
#    proxy_read_timeout 200;
#    lingering_timeout 0;
#    #temp_file_buffer
    #large_client_header_buffers 4 256k;
    #client_max_body_size 3000m;
    #client_header_buffer_size 2048m; 
    #client_body_buffer_size 1024m; 
#    open_file_cache max=102400 inactive=40s;
    proxy_buffers  16 4k;
    proxy_buffer_size 4k;
#    proxy_http_version   1.1;
#    chunked_transfer_encoding on;
    proxy_buffering off;
    # server_names_hash_bucket_size 128;

    gzip  off;

    upstream bk75{
        server 192.168.5.15:8099;
        keepalive 60000;
    }

    upstream bk76{
        #server 172.25.101.10:8001;
        server 192.168.5.15:8098;
        keepalive 60000;
    }

    upstream bk77{
        #server 172.25.101.10:8002;
        server 192.168.5.15:8097;
        keepalive 60000;
    }

    server {
        # listen       8088 ssl;
        listen       80;
        # listen       8088 proxy_protocol;
        server_name  localhost;

        # ssl_certificate      /root/ssl_key/server.pem;
        # ssl_certificate_key  /root/ssl_key/server.key;

        # ssl_session_cache    shared:SSL:1m;
        # ssl_session_timeout  5m;

        # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        # ssl_ciphers  HIGH:!aNULL:!MD5;
        # ssl_prefer_server_ciphers  on;       
        # proxy_ssl_server_name on;
        
        # set_real_ip_from 172.171.16.0/24;
        # real_ip_header proxy_protocol;
        #server_tokens off;
        #proxy_hide_header Host;

        location / {
#	return 200 "a";
            root   html;
            index  index.html index.htm; 
proxy_set_header Connection "";
proxy_http_version  1.1;
chunked_transfer_encoding on;
            # proxy_pass http://127.0.0.1:8017/; 
            proxy_pass http://bk75/;
            # proxy_pass http://172.171.16.240:80/; 
            # rewrite ^/(.*) http://127.0.0.1:8087/ redirect;     
#            proxy_set_header X-Original-URI $request_uri;
#            proxy_set_header Host $host:$server_port;                
            mirror /mimic1;
            mirror /mimic2;   
            # mirror /mimic3; 
            # mirror /mimic4;                                  
            mirror_request_body on;

#            proxy_set_header Connection "";
        }        

        location /mimic1{           
            proxy_pass http://bk76$request_uri;
proxy_set_header Connection "";
proxy_http_version  1.1;
chunked_transfer_encoding on;
            # proxy_pass http://127.0.0.1:8018$request_uri;
            # proxy_pass http://172.171.16.246:80$request_uri;
#            proxy_set_header X-Original-URI $request_uri;
#            proxy_set_header Host $host:$server_port;            
#   	    proxy_set_header Connection "";
        }

        location /mimic2{   
            proxy_pass http://bk77$request_uri;
proxy_set_header Connection "";
proxy_http_version  1.1;
chunked_transfer_encoding on;
            # proxy_pass http://127.0.0.1:3000$request_uri;            
            # proxy_pass http://127.0.0.1:8019$request_uri;
            # proxy_pass http://172.171.16.247:80$request_uri;          
#            proxy_set_header X-Original-URI $request_uri;
#            proxy_set_header Host $host:$server_port;
#   	    proxy_set_header Connection "";
        }

#        error_page   500 502 503 504  /50x.html;
#        location = /50x.html {
#            root   html;           
#        }        
    }    
}
