zoukankan      html  css  js  c++  java
  • http强转https websocket

    需要在httpd.conf文件最后添加即可:

    <Directory />

        Options FollowSymLinks

        AllowOverride All

    RewriteEngine on

    RewriteCond %{SERVER_PORT} !^443$

    RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

    </Directory>

    之后重启apache即可。

    apache的websocket配置

    #虚拟主机实现端口代理
    <VirtualHost *:8887>
    #         ServerAdmin zhongsheng.xu@hand-china.com
    #         ServerName localhost
    #         ServerAlias localhost         

             #websocket
             RewriteEngine On
             RewriteCond %{HTTP:Connection} Upgrade [NC]
             RewriteCond %{HTTP:Upgrade} websocket [NC]        
             RewriteRule /core/([sS]*) ws://192.168.198.205:8888/core/$1 [P]

             ProxyPass /core http://192.168.198.205:8888/core
             ProxyPassReverse /core http://192.168.198.205:8888/core

             #端口映射
    #         ProxyPass / ajp://localhost:8009/  
    #         ProxyPassReverse / ajp://localhost:8009/
    #         ErrorLog "logs/lbtest-error.log"
    #         CustomLog "logs/lbtest-access.log" common
    </VirtualHost>

  • 相关阅读:
    ACdream 1224 Robbers (贪心)
    HDU 4320 Arcane Numbers 1 (质因子分解)
    在脚本中重定向输入
    呈现数据
    shell中的for、while、until(二)
    shell中的for、while、until
    C 指针疑虑
    结构化命令
    fdisk -c 0 350 1000 300命令
    PC机上的COM1口和COM2口
  • 原文地址:https://www.cnblogs.com/js1314/p/10265218.html
Copyright © 2011-2022 走看看