#测试系统-https
upstream test_server {
	server  127.0.0.1:8180 weight=1 max_fails=2 fail_timeout=80s;
	#server  10.111.16.11:8180 weight=1 max_fails=2 fail_timeout=80s;
}
#测试系统-http-默认转到https
server {  
    listen 80;  
    server_name test.xxx.com;  
    rewrite ^(.*)$  https://$host$1 permanent;  
}
#测试系统-https
server {
	listen 443 ssl;
	server_name test.xxx.com; #填写绑定证书的域名
	client_max_body_size 500M;
	charset utf-8;
	access_log  /data/logs/nginx/access_main.log  main;
	proxy_set_header        Host			$host;
	proxy_set_header        X-Real-IP		$remote_addr;
	proxy_set_header        X-Forwarded-For		$proxy_add_x_forwarded_for;
	proxy_set_header	X-Forwarded-Proto	$scheme; 
	#ssl on;
	ssl_certificate /data/ssl/test.xxx.com_nginx/test.xxx.com_bundle.crt;
	ssl_certificate_key /data/ssl/test.xxx.com_nginx/test.xxx.com.key;
	ssl_session_timeout 5m;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置
	ssl_prefer_server_ciphers on;
	
	#location = /Nws1RIO07B.txt {
	#	proxy_pass http://property_server_https/property/Nws1RIO07B.txt;
	#	break;
        #}
	# WebSocket 请求
	location /endpointChat/info {
		proxy_pass http://test_server;
		#转发websocket需要的设置
		proxy_http_version 1.1;
	        proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection 'Upgrade';
		break;
        }
	location /answer {
		proxy_pass http://127.0.0.1:8171;
		#转发websocket需要的设置
		proxy_set_header X-Real-IP $remote_addr;
		proxy_buffering off;
		proxy_connect_timeout 30;
		proxy_send_timeout 330;
		proxy_read_timeout 330;
		proxy_redirect default ;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		break;
	}
	location ^~ /swagger-- {
	   rewrite ^(.*)$  https://$host/swagger permanent; 
	}
	location / {
		proxy_pass http://test_server;
		#转发websocket需要的设置
		#proxy_set_header Host $host:80;
		#proxy_http_version 1.1;
	        #proxy_set_header Upgrade $http_upgrade;
		#proxy_set_header Connection "Upgrade";
		break;
	}
}