【问题标题】:Why Apache HTTPD is concatenating websocket url in rewrite engine?为什么 Apache HTTPD 在重写引擎中连接 websocket url?
【发布时间】:2019-02-08 06:26:53
【问题描述】:

我在 Apache 重写引擎机制上苦苦挣扎,尤其是 websocket 重写。

我的 httpd.conf 中有这个配置:

    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
    [...]
    <IfModule mod_rewrite.c>
            LogLevel rewrite:trace8
            RewriteEngine On
            RewriteCond %{HTTP:UPGRADE} ^(.*)WebSocket(.*)$ [NC]
            RewriteCond %{HTTP:CONNECTION} ^(.*)Upgrade(.*)$ [NC]
            RewriteRule .* ws://host_to_redirect%{REQUEST_URI} [P]
    </IfModule>

但是这个配置似乎不起作用,我在我的 host_to_redirect 中没有看到日志 URL 调用。但是,我在 Apache 中看到了这个重写日志:

[2018 年 8 月 31 日星期五 10:21:35.170174] [rewrite:trace1] [pid 27194] mod_rewrite.c(468): [client 160.35.1.22:54354] 160.35.1.22 - - [host_apache_httpd/sid#7f150fe11a70] [rid#7f15105ea430/initial] 继续代理请求 proxy:https://host_apache_httpd/ws://host_to_redirect/websocket/ack/297/051schka/websocket [OK]

Apache 将 Apache 主机和目标主机连接在一起。像 Apache 不了解 websocket 协议。但是wstunnel模块已经完全激活了……

你有什么想法吗? :) 谢谢!

规格

  • Centos6
  • Apache 2.4.6

【问题讨论】:

    标签: apache mod-rewrite websocket


    【解决方案1】:

    终于找到答案了!

    这是 Apache 上的一个已知问题:https://bz.apache.org/bugzilla/show_bug.cgi?id=55598

    您必须升级您的 Apache HTTPD 才能使其正常工作!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-07
      • 2012-06-30
      • 2012-11-30
      • 2016-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-13
      相关资源
      最近更新 更多