
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#error_log  "pipe:rollback logs/error_log interval=1d baknum=7 maxsize=2G";

#pid        logs/nginx.pid;

worker_rlimit_nofile 65535;
events {
    worker_connections  10240;
}



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  "pipe:rollback logs/access_log interval=1d baknum=7 maxsize=2G"  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

	client_header_buffer_size 32k;
    large_client_header_buffers 8 32k;
    client_max_body_size 100m;
    client_body_buffer_size 128k;
    client_body_temp_path  /usr/local/nginx/client_temp 1 2;


    gzip  on;
	gzip_min_length 1k; #压缩阈值  
	gzip_buffers 4 16k; #buffer 不用修改  
	gzip_comp_level 2;  #压缩级别:1-10，数字越大压缩的越好，时间也越长 
	gzip_vary off; 
	gzip_types js css application/script text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg mage/gif image/png image/bmp application/x-bmp image/x-ms-bmp application/vnd.ms-fontobject font/ttf font/opentype font/x-woff;  



    map $host $proxy_port{
		"jwjxrn.0000206.pre2.hieap.cn" "37948";
		"kfzxcx.0000220.pre2.hieap.cn" "43695";
		"kfzrn.0000220.pre2.hieap.cn" "36213";
		"kfz.0000220.pre2.hieap.cn" "32934";
		"hzlxcx.admin.pre2.hieap.cn" "39101";
		"hzlrn.admin.pre2.hieap.cn" "38728";
		"hzl.admin.pre2.hieap.cn" "39452";
		"test1xcx.0000247.pre2.hieap.cn" "34513";
		"test1rn.0000247.pre2.hieap.cn" "40020";
		"test1.0000247.pre2.hieap.cn" "40705";
		"tpl.0000203.pre2.hieap.cn" "38050";
		"newproject.0000207.pre2.hieap.cn" "40650";
		"mflm.0000221.pre2.hieap.cn" "43447";
		"jwjx.0000206.pre2.hieap.cn" "38889";
		"cpp.0000207.pre2.hieap.cn" "36639";
		"erp.0000212.pre2.hieap.cn" "46153";
		"dcp.0000220.pre2.hieap.cn" "33234";
		"cms.0000221.pre2.hieap.cn" "41274";
		"hccd.0000221.pre2.hieap.cn" "43837";
		"alys.0000299.pre2.hieap.cn" "43785";
		"eap5csxm.admin.pre2.hieap.cn" "39784";
    }
	server {

	    listen              8001;
	    server_name  ~^(\w)*?\.(\w)*?\.pre2\.hieap\.cn$;


	    location / {
		   proxy_pass    http://127.0.0.1:$proxy_port;
		  
	       proxy_http_version 1.1;
	       proxy_set_header Upgrade $http_upgrade;
	       proxy_set_header Connection "upgrade";
	       proxy_set_header X-real-ip $remote_addr;
	       proxy_set_header X-Forwarded-For $remote_addr;
	       proxy_set_header Origin "";

			proxy_buffer_size 2048k; #设置代理服务器（nginx）保存用户头信息的缓冲区大小
			proxy_buffers 16 2048k; #proxy_buffers缓冲区，网页平均在32k以下的设置
			proxy_busy_buffers_size 4096k; #高负荷下缓冲大小（proxy_buffers*2）
			proxy_temp_file_write_size 4096k;#设定缓存文件夹大小，大于这个值，将从upstream服务器传

	       index  index.html index.htm;
	   }
    }



	server {
        listen       5153;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;

        location / {
            root   /usr/local/app/visualStudio;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }


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

    }

	server {
        listen       5154;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;

        location / {
            root   /usr/local/app/visualStudio_test;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }


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

    }

	server {
        listen       5156;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;

        #
        error_page   500 502 503 504  /50x.html;
        location / {
            root   /usr/local/app/hieap-devcenter;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }
    }


	server {
        listen       5177;
        server_name  localhost;

        error_page   500 502 503 504  /50x.html;
        location / {
            root   /usr/local/app/hiui-mb/dist;
            index  index.html index.htm;
        }
    }


}
