1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| 后端workerman集群,7272端口,websocket协议 upstream websocket { server 172.31.7.240:7272; server 172.31.0.163:7272; } 定义https配置 server { listen 443 ssl;
ssl_certificate /etc/nginx/conf.d/server.pem; ssl_certificate_key /etc/nginx/conf.d/server.key; ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; 来自域名/wss的访问都代理到workerman集群 location /wss { proxy_pass http://websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; } location / {} 站点的其它配置... }
|