本篇文章為大家展示了websocket中怎么配置https 連接,內容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。
websocket 地址
'wss://hongonew.com/hone/web/websocket/';
nginx 配置
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;
}上述內容就是websocket中怎么配置https 連接,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。