wss網(wǎng)上什么意思 nginx如何同時配置https和wss?
nginx如何同時配置https和wss?nginx同時配置https和wss代碼如下:server{listen443sslserver_namelocalhostsslonroothtmlinde
nginx如何同時配置https和wss?
nginx同時配置https和wss代碼如下:server{listen443sslserver_namelocalhostsslonroothtmlindexindex.htmlindex.htmssl_certificate ******.pemssl_certificate_key *******.keyssl_session_timeout5mssl_ciphersECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4ssl_protocolsTLSv1TLSv1.1TLSv1.2ssl_prefer_server_ciphersonlocation/{proxy_pass https://localhost:3001}location/ws{proxy_passhttps://localhost:8181 proxy_read_timeout60sproxy_http_version1.1proxy_set_headerUpgrade$http_upgradeproxy_set_headerConnection"Upgrade"} }WebSocket協(xié)議的握手和HTTP是兼容的,它使用HTTP的Upgrade協(xié)議頭將連接從HTTP連接升級到WebSocket連接。這個特性使得WebSocket應(yīng)用程序可以很容易地應(yīng)用到現(xiàn)有的基礎(chǔ)設(shè)施。就可以使用https// 域名訪問和使用wss:// 域名+/ws訪問了