大米CMS官网论坛,大米站长联盟,大米站长之家,大米开发者社区

 找回密码
 注册大米会员

QQ登录

只需一步,快速开始

查看: 4521|回复: 0

windows服务器http升级https后,apache服务器ws如何升级到wss?

[复制链接]

493

主题

770

帖子

7596

积分

超级版主

Rank: 8Rank: 8

积分
7596

商城钻石VIP授权用户

发表于 2021-8-14 14:26:21 | 显示全部楼层 |阅读模式
本帖最后由 追影 于 2021-8-14 14:28 编辑

1:开启module
  1. LoadModule proxy_module modules/mod_proxy.so
  2. LoadModule proxy_http_module modules/mod_proxy_http.so
  3. LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
复制代码



2:httpd-ssl.conf虚拟主机配置修改
  1. SSLEngine on
  2. SSLProtocol all -SSLv2 -SSLv3
  3. SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM

  4. SSLCertificateFile "D:/xampp/cert/qianxun.damicms.com-crt.pem"
  5. SSLCertificateKeyFile "D:/xampp/cert/qianxun.damicms.com-key.pem"
  6. SSLCertificateChainFile "D:/xampp/cert/qianxun.damicms.com-chain.pem"

  7. <FilesMatch "\.(cgi|shtml|phtml|php)$">
  8.     SSLOptions +StdEnvVars
  9. </FilesMatch>
  10. <Directory "/xampp/apache/cgi-bin">
  11.     SSLOptions +StdEnvVars
  12. </Directory>

  13. <Directory "D:/web/qianxun">
  14.         Options -Indexes +SymLinksIfOwnerMatch
  15.         AllowOverride all
  16.         Order allow,deny
  17.         Allow from All
  18.         DirectoryIndex index.htm index.html index.php default.php
  19. </Directory>


  20. RewriteEngine on
  21. RewriteCond %{HTTP:Upgrade} websocket [NC]
  22. RewriteCond %{HTTP:Connection} upgrade [NC]
  23. RewriteRule ^/?(.*) "ws://127.0.0.1:1207/$1" [P,L]

  24. SSLProxyEngine on
  25. ProxyPass /wss ws://服务器IP:1207
  26. ProxyPassReverse /wss wss://域名/danmu
复制代码

客户端连接地址 就是
  1. wss://域名/danmu
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册大米会员

本版积分规则

QQ|小黑屋|大米CMS社区 ( 蜀ICP备11002200号-2广告联系:广告联系 

Powered by 大米CMS

© 2010-2020 大米CMS Inc.

快速回复 返回顶部 返回列表