简体   繁体   English

Apache 模块 mod_proxy_wstunnel 不工作

[英]Apache Module mod_proxy_wstunnel not working

I have a website running at http://XXX.XXX.XXX.XXX:3000 and it runs [Botpress][1] In order to have it running via HTTPS I made an Apache reverse proxy configuration: My file looks like:我有一个运行在http://XXX.XXX.XXX.XXX:3000的网站,它运行 [Botpress][1] 为了让它通过 HTTPS 运行,我做了一个 Apache 反向代理配置:我的文件看起来像:

SSLProxyEngine on
ProxyPass "/"  "http://XXX.XXX.XXX.XXX:3000/"
ProxyPassReverse "/"  "http://XXX.XXX.XXX.XXX:3000/"
ProxyPass "/socket.io/" "ws://XXX.XXX.XXX.XXX:3000/socket.io/"
ProxyPassReverse "/socket.io/" "ws://XXX.XXX.XXX.XXX:3000/socket.io/"

Now if I go to https://botpress.mywebsite.com I see the Botstrap admin interface working however when I login I see an error in the browser's console showing:现在,如果我从 go 到https://botpress.mywebsite.com ,我看到 Botstrap 管理界面正在工作,但是当我登录时,我在浏览器的控制台中看到错误显示:

Firefox can't establish a connection to the server at wss://botpress.mywebsite.com/socket.io/?visitorId=_GUWkjNu-VH9XpE3DpO76PxD&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....&transport=websocket. Firefox 无法与位于 wss://botpress.mywebsite.com/socket.io/?visitorId=_GUWkjNu-VH9XpE3DpO76PxD&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....&transport=websocket 的服务器建立连接。 web.100.....94b.js:2:6616130 was interrupted while the page was loading. web.100.......94b.js:2:6616130 在页面加载时被中断。

Is there something wrong in my config file with the ProxyPass & ProxyPassReverse for socket.io? socket.io 的 ProxyPass 和 ProxyPassReverse 配置文件有问题吗?

Thanks.谢谢。 [1]: https://botpress.com/ [1]: https://botpress.com/

i spent a few days on this.我花了几天时间。 I found the problem was really in the order things were added in conf file.我发现问题确实出在 conf 文件中添加内容的顺序上。

‘RewriteEngine On’
‘RewriteCond %{QUERY_STRING} transport=polling [OR]’
‘RewriteCond %{REQUEST_URI} /socket.io/socket.io.js’
‘RewriteRule /socket.io/(.*)$ http://localhost:3000/socket.io/$1 [P]’
‘ProxyPass /socket.io/ ws://localhost:3000/socket.io/‘
‘ProxyPassReverse /socket.io/ ws://localhost:8082/socket.io/‘
‘ProxyPass / http://localhost:3000/‘
‘ProxyPassReverse / http://localhost:3000’
‘ProxyPreserveHost on’ 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM