gpt4 book ai didi

java - apache2.4.6 wstunnel 代理到 tomcat 7 错误意外 200 repsonse

转载 作者:行者123 更新时间:2023-11-28 22:56:39 24 4
gpt4 key购买 nike

我的一切都被正确代理了,只是我的 websockets 不断给我一个意外的 200 响应错误。我在 chrome 和 firefox 上使用 native websockets。

我的配置文件是这样的

<VirtualHost example.com:80>
ServerName example.com
ProxyRequests Off
ProxyPass /websocket/ ws://localhost:8080/XXXXX/websocket/ retry=0
ProxyPassReverse /websocket/ ws://localhost:8080/XXXXX/websocket/ retry=0
ProxyPass / http://localhost:8080/XXXXX/
ProxyPassReverse / http://localhost:8080/XXXXX/
ProxyPassReverseCookiePath /XXXXX /
</VirtualHost>

这里是准确的错误,所以没有混淆。

Error during WebSocket handshake: Unexpected response code: 200

最佳答案

我在 Ubuntu 15.04 上的 apache2 版本 2.4.10 中遇到了与 modproxy 和 wstunnel 模块类似的问题。我使用 tcpflow 弄清楚发生了什么,看到我的 HTTP 代理工作正常并将所有内容发送到我的 nodejs 服务器,但是我的 websocket 代理直接返回了位于/的网站。

幸运的是,我有一台配置几乎相同的 Debian 服务器,我发现唯一的区别如下:

在非工作服务器上:

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

在工作服务器上:

<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

我不知道为什么这对我的情况有效,但我希望将 Directory 指令添加到您的 VirtualHost 也能解决您的问题。

关于java - apache2.4.6 wstunnel 代理到 tomcat 7 错误意外 200 repsonse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25540103/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com