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>

  • 相关阅读:
    IE6中布局常见问题
    -bash: grunt-cli: command not found
    字符长度
    Mac下safari、chrome打开开发者工具快捷键
    line-height:150%和line-height:1.5的区别
    JavaScript中的apply()、call()、bind()
    JavaScript中的 this
    JavaScript中的var与作用域
    onload与ready的区别
    浏览器的同源策略
  • 原文地址:https://www.cnblogs.com/js1314/p/10265218.html
Copyright © 2011-2022 走看看