websocket 地址 nginx
'wss://hongonew.com/hone/web/websocket/';
nginx 配置web
server { listen 443 ssl; server_name hongonew.com; ssl on; ssl_certificate **; ssl_certificate_key **; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location ~/hone/{ proxy_pass http://127.0.0.1:8080; index dashboard index; #websocket額外配置開始 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_connect_timeout 60s;#l鏈接超時時間,不能設置太長會浪費鏈接資源 proxy_read_timeout 500s;#讀超時時間 proxy_send_timeout 500s;#寫超時時間 #websocket額外配置結束 proxy_set_header Host $http_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; } access_log logs/https_access.log; error_log logs/https_error.log; }