In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to solve the An insecure WebSocket problem of using nginx to configure ssl certificate", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "how to solve the An insecure WebSocket problem of using nginx to configure ssl certificate"!
Question:
Use nginx to configure the ssl certificate. When deploying the project, it is found that the ws protocol has failed and must be changed to the wss protocol. Websocket uses ws or wss, which is similar to HTTP or HTTPS, where wss represents Websocket on top of TLS, which is equivalent to HTTPS. By default, Websocket's ws protocol uses port 80. When running on TLS, the wss protocol uses port 443 by default.
Solution method
Refer to the official document: http://nginx.org/en/docs/http/websocket.html
Add the following configuration to nginx:
Location / websocket {proxy_pass http://myblog.lwenhao.com:8080/myblog/websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";}
Need the agent to forward to your real websocket address. I applied for a free ssl certificate for the domain name on Ali. The front end can only request it through the domain name applying for the certificate, not through the first-and second-level domain names.
Note:
By default, if the proxy server does not transfer any data within 60 seconds, the connection is closed. Use the proxy_read_timeout directive to increase this timeout. Alternatively, the proxy server can be configured to send WebSocket ping frames periodically to reset the timeout and check if the connection still exists.
Thank you for your reading, the above is the content of "how to solve the An insecure WebSocket problem of using nginx to configure ssl certificate". After the study of this article, I believe you have a deeper understanding of how to solve the An insecure WebSocket problem of using nginx to configure ssl certificate, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.