upstream gateway21000 { server 127.0.0.1:21000; } server { listen 443; ssl on; ssl_certificate cert/leshu.com_bundle.crt; ssl_certificate_key cert/server.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_name knifegate21000.leshu.com; charset utf-8; access_log /data/logs/nginx_logs/proxy.log main; location / { proxy_pass http://gateway21000; proxy_http_version 1.1; proxy_read_timeout 3600s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
443端口为wss的固定端口,必须开放出来
ssl为证书的地址 ssl_certificate ssl_certificate_key
server_name knifegate21000.leshu.com; 就是你的域名了需要解析到这台机器上
同时你的wsbin文件需要开放21000端口