##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
	listen 8090;


		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
	server_name  _;

         index  index.html;
         root  /game/website/afh5/1.0.1/;         

	location ^~ /user/ {			
		proxy_pass http://47.122.0.171:9002;			
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
	}
			
	    fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600; 


}

server
{
        listen       9833;
        server_name _;
		location / {
         index  index.html;
         root  /game/website/afh5/crm/client/;
         fastcgi_connect_timeout 600;
         fastcgi_send_timeout 600;
         fastcgi_read_timeout 600;  
		}
        location /mkapi {
        proxy_pass http://127.0.0.1:9920;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		}
}


server
{
        listen 443  ssl;
        ssl on;
        server_name  yeshi-test.chenjinlei.xyz;
        
	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
         index  index.html;
         root  /game/website/afh5/1.0.1/;         
		 fastcgi_connect_timeout 600;
		 fastcgi_send_timeout 600;
		 fastcgi_read_timeout 600; 
	}

	location ^~ /user/ {			
		proxy_pass http://127.0.0.1:9002;			
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
	}
		ssl_certificate   ssl/8677451_yeshi-test.chenjinlei.xyz.pem;
		ssl_certificate_key  ssl/8677451_yeshi-test.chenjinlei.xyz.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;

        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;   

}

server
{
        listen 443  ssl;
        ssl on;
        server_name  www.pdmarket.cn;
	client_max_body_size 60m;
	client_body_buffer_size 60m;
        
	location /finance/ {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
         index   index.html;
         root  /game/website/afh5/1.0.1/;         
		 try_files $uri $uri/ /finance/index.html;
	}

	location ^~ /user/ {			
		proxy_pass http://127.0.0.1:9002;			
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
	}
	
	location ^~ /ocrm/ {			
		proxy_pass https://www.pdmarket.cn:6379;		
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
	}
		ssl_certificate   ssl/8849991_www.pdmarket.cn.pem;
		ssl_certificate_key  ssl/8849991_www.pdmarket.cn.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;

        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;   

}

server {
        listen       9832;
        listen       [::]:9832;
        root         /game/website/afh5/1.0.1/;
		
}

server {
        listen       80;
        listen       [::]:80;
        root         /game/website/afh5/1.0.1/;
		
}

server {
        listen       9834;
        listen       [::]:9834;
        root         /game/website/afh5/1.0.1/yibian/;
		client_max_body_size 60m;
		
		location / {  
			root /game/website/afh5/1.0.1/yibian/;
			try_files $uri $uri/ @router;
			index index.html index.htm;   
		}
		
		location /admin {
			root /game/website/afh5/1.0.1/yibian/;
				index  index.html index.htm;
			try_files $uri $uri/ /admin/index.html;
		}
		
		location @router {
			rewrite ^.*$ /index.html last;
		}
		
		location /api/ {			
			proxy_pass http://47.122.0.171:9989/;		
			proxy_redirect off;			
			proxy_set_header Host $host;			
			proxy_set_header X-Real-IP $remote_addr;			
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
		}
		
}

server {
        listen       9835;
        listen       [::]:9835;
        root         /game/website/afh5/1.0.1/greenrock/;
		client_max_body_size 60m;
		
		location / {  
			root /game/website/afh5/1.0.1/greenrock/;
			try_files $uri $uri/ @router;
			index index.html index.htm;   
		}
		
		location /admin {
			root /game/website/afh5/1.0.1/greenrock/;
				index  index.html index.htm;
			try_files $uri $uri/ /admin/index.html;
		}
		
		location @router {
			rewrite ^.*$ /index.html last;
		}
		
		location /api/ {			
			proxy_pass http://47.122.0.171:8081/;		
			proxy_redirect off;			
			proxy_set_header Host $host;			
			proxy_set_header X-Real-IP $remote_addr;			
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
		}
		
}

# crmeb 管理后台
server {
        listen       9836;
        listen       [::]:9836;
        root         /usr/local/crmeb/;
		
		location / {  
			root /usr/local/crmeb/admin/;
			try_files $uri $uri/ @router;
			index index.html index.htm;   
		}
		#本地图片
		location /crmebimage/ {  
			alias /usr/local/crmeb/crmebimage/;
			autoindex on;
		}
		
		location @router {
			rewrite ^.*$ /index.html last;
		}

}


# crmeb H5端
server {
        listen       9837;
        listen       [::]:9837;
        root         /usr/local/crmeb/;
		
		location / {  
			root /usr/local/crmeb/app/;
			try_files $uri $uri/ @router;
			index index.html index.htm;   
		}
		
		location @router {
			rewrite ^.*$ /index.html last;
		}
		
}
# crmeb 管理后台
server {
        listen       9838;
        listen       [::]:9838;
        root         /usr/local/crmeb/;
		
		#本地图片
		location /crmebimage/ {  
			alias /usr/local/crmeb/crmebimage/;
			autoindex on;
		}

}



server {
        listen       8833;
        listen       [::]:8833;
        server_name  _;
        root         /game/website/afh5/1.0.1/;
		
}



server
{
	listen 443  ssl;
	ssl on;
	server_name  hans.pdmarket.cn;
	
	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
         index  index.html;		 
         root  /game/website/afh5/1.0.1/;         
		 fastcgi_connect_timeout 600;
		 fastcgi_send_timeout 600;
		 fastcgi_read_timeout 600; 
	}
	
		location ^~ /hsgy/ {			
		proxy_pass https://hans.pdmarket.cn:6479;		
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
	}

	ssl_certificate   ssl/8914257_hans.pdmarket.cn.pem;
	ssl_certificate_key  ssl/8914257_hans.pdmarket.cn.key;
	ssl_session_timeout 5m;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;

	fastcgi_connect_timeout 600;
	fastcgi_send_timeout 600;
	fastcgi_read_timeout 600;   

}

server
{
	listen 9999  ssl;
	ssl on;
	server_name  www.wiseplanet.com.cn;
	

	
	location / {			
		proxy_pass http://58.247.49.58:9999;		
		proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";		
	}

	ssl_certificate   ssl/8323933_www.wiseplanet.com.cn.pem;
	ssl_certificate_key  ssl/8323933_www.wiseplanet.com.cn.key;
	ssl_session_timeout 5m;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;

	fastcgi_connect_timeout 600;
	fastcgi_send_timeout 600;
	fastcgi_read_timeout 600;   

}



server {
        listen       443 ssl;
        listen       [::]:443;
		ssl on;
        server_name  www.wiseplanet.com.cn;
        root         /game/website/afh5/1.0.1/;
			
		location ^~ /video/ {			
		proxy_pass http://58.247.49.58:9988;		
		proxy_redirect off;			
		proxy_set_header Host $host;			
		proxy_set_header X-Real-IP $remote_addr;			
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	
	}

		
		ssl_certificate   ssl/8323933_www.wiseplanet.com.cn.pem;
		ssl_certificate_key  ssl/8323933_www.wiseplanet.com.cn.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;
}

server
{
        listen 443  ssl;
        ssl on;
        server_name  www.yibianshoucang.com;
        root         /game/website/afh5/1.0.1/ybweb/;

		location /api/ {			
			proxy_pass http://47.122.0.171:9989/;		
			proxy_redirect off;			
			proxy_set_header Host $host;			
			proxy_set_header X-Real-IP $remote_addr;			
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
		}
		
		
		location ^~ /new_battle/ {			
			proxy_pass http://127.0.0.1:7379;
			proxy_redirect off;			
			proxy_set_header Host $host;			
			proxy_set_header X-Real-IP $remote_addr;			
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
		}
		
		ssl_certificate   ssl/9475984_www.yibianshoucang.com.pem;
		ssl_certificate_key  ssl/9475984_www.yibianshoucang.com.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;


}

server
{
        listen 443  ssl;
        ssl on;
        server_name  admin.yibianshoucang.com;
        root         /game/website/afh5/1.0.1/;

		location /api/ {			
			proxy_pass http://47.122.0.171:9989/;		
			proxy_redirect off;			
			proxy_set_header Host $host;			
			proxy_set_header X-Real-IP $remote_addr;			
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;		
		}
		
		
		ssl_certificate   ssl/9476239_admin.yibianshoucang.com.pem;
		ssl_certificate_key  ssl/9476239_admin.yibianshoucang.com.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;


}

server
{
        listen 443  ssl;
        ssl on;
        server_name  meta-chat.yibianshoucang.com;
        root         /game/website/afh5/1.0.1/;

		location / {			
			proxy_pass http://127.0.0.1:9900;	
			proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection "Upgrade";		
		}
		
		
		ssl_certificate   ssl/9486032_meta-chat.yibianshoucang.com.pem;
		ssl_certificate_key  ssl/9486032_meta-chat.yibianshoucang.com.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;


}

server
{
        listen 443  ssl;
        ssl on;
        server_name  grock.yibianshoucang.com;
        root         /game/website/afh5/1.0.1/grock/;

		
		ssl_certificate   ssl/9555557_grock.yibianshoucang.com.pem;
		ssl_certificate_key  ssl/9555557_grock.yibianshoucang.com.key;
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
		ssl_prefer_server_ciphers on;


}