#------------------ 公共sdk后台配置 -------------------
server {
                listen     33080;
                server_name localhost public.sdk.gzyouai.com bg.public.sdk.gzyouai.com;
                client_max_body_size 500M;
                location ~ ^/static/ {
                        root /data/www/sdk_center;
                        #expires 24h;
                        access_log off;
                }
                location ~* ^.+.(mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|txt|tar|mid|midi|wav|rtf|mpeg)$
                {
                        root /data/www/sdk_center/static;
                        access_log off;
                }
                location / {
                        
                        include     uwsgi_params;
                        uwsgi_read_timeout 580;
                        uwsgi_send_timeout 580;
                        proxy_read_timeout 580;
                        uwsgi_connect_timeout 900;
                        uwsgi_pass   127.0.0.1:9101;
                        access_log  off;
                }
}

#--------cdn ------------------
server {
                listen     80;
                server_name localhost bg.public.sdk.gzyouai.com cdn.sdk.gzyouai.com apk.cdn.9133.com apk.cdn.i9133.com download.9133.com;
                client_max_body_size 20M;
                root /data/www/sdk_center/static;
                access_log off;

                location ~* ^.+.(mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|txt|tar|mid|midi|wav|rtf|mpeg)$
                {
                        root /data/www/sdk_center/static;
                        access_log off;
                }
}

upstream sdk_statistic {
	server 127.0.0.1:3001;
	server 127.0.0.1:3002;
	server 127.0.0.1:3003;
	server 127.0.0.1:3004;	
	#server 127.0.0.1:3005;	
	#server 127.0.0.1:3006;	
	#server 127.0.0.1:3007;	
	#server 127.0.0.1:3008;	
	keepalive 16;
}


#sdk统计服务
server {
    listen       9030;
    server_name  localhost public.sdk.gzyouai.com statistic.public.sdk.gzyouai.com;
    #server_name_in_redirect off;
    
    access_log off;
    #access_log  /data/nginx_logs/nginx_sdk_pay_access.log;
    client_max_body_size 100m;
    location / {
                proxy_pass_header Server;
                proxy_http_version 1.1;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Scheme $scheme;
                proxy_set_header REMOTE-HOST $remote_addr;
                keepalive_timeout  0;
                access_log  off;
                proxy_pass  http://sdk_statistic;
                }
}
server {
    listen       80;
    server_name  statistic.public.sdk.gzyouai.com *.9133.com;
    #server_name_in_redirect off;
    location = /BF0C99CDF17E125B6A83F4D1CA07098D.txt {
            root /data/www/sdk_center/static;  
    }
    location ~ ^/tg/ {
                        root /data/www/sdk_center/static;
                        #expires 24h;
                        access_log off;
    }
    access_log off;
    #access_log  /data/nginx_logs/nginx_sdk_pay_access.log;
    client_max_body_size 100m;
    location ~ ^/static/ {
              root /data/www/sdk_center;
              #expires 24h;
              access_log off;
    }
    location / {
                proxy_pass_header Server;
                proxy_http_version 1.1;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $http_remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Scheme $scheme;
                proxy_set_header REMOTE-HOST $remote_addr;
                keepalive_timeout  0;
                access_log  off;
                proxy_pass  http://sdk_statistic;
                }
}


#ssl
server {
    listen       443;
#   server_name  statistic.public.sdk.gzyouai.com;
    #server_name_in_redirect off;
    location = /BF0C99CDF17E125B6A83F4D1CA07098D.txt {
            root /data/www/sdk_center/static;  
    }
    access_log off;
    location ~ ^/static/ {
              root /data/www/sdk_center;
              expires 24h;
              #access_log off;
    }
    #access_log  /data/nginx_logs/nginx_sdk_pay_access.log;
    client_max_body_size 100m;
    location / {
                proxy_pass_header Server;
                proxy_http_version 1.1;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Scheme $scheme;
                proxy_set_header REMOTE-HOST $remote_addr;
                keepalive_timeout  0;
                access_log  off;
                proxy_pass  http://sdk_statistic;
                }
}
