NGINX反向代理websocket并启用SSL(wss://)?

编程入门 行业动态 更新时间:2024-10-28 08:17:03
本文介绍了NGINX反向代理websocket并启用SSL(wss://)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我很迷茫,不愿独自构建NGINX,但我希望能够启用安全的websocket,而无需增加额外的层.

I'm so lost and new to building NGINX on my own but I want to be able to enable secure websockets without having an additional layer.

我不想在websocket服务器本身上启用SSL,但是我想使用NGINX在整个事情上添加一个SSL层.

I don't want to enable SSL on the websocket server itself but instead I want to use NGINX to add an SSL layer to the whole thing.

那里的每个网页都说我做不到,但是我知道我可以!感谢任何人(我自己)可以向我展示如何!

Every web page out there says I can't do it, but I know I can! Thanks to whoever (myself) can show me how!

推荐答案

仅需注意,nginx现在已在1.3.13版本上支持Websockets.使用示例:

Just to note that nginx has now support for Websockets on the release 1.3.13. Example of use:

location /websocket/ { proxy_pass ​backend_host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 86400; }

您还可以检查 nginx更改日志和 WebSocket代理文档.

更多推荐

NGINX反向代理websocket并启用SSL(wss://)?

本文发布于:2023-11-12 19:20:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582308.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:websocket   NGINX   wss   SSL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!