websocket 无法通过 apache 反向代理连接

websocket 无法通过 apache 反向代理连接

我正在使用特米纳多我在 Docker 容器内部的端口上运行unique.pydemo 文件夹9090,其 IP 为172.17.0.2

因此我使用 apache2 设置了反向代理:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName  terminal.local
    ServerAlias terminal.kide
    DocumentRoot /home/satnam-sandhu/Workstation/virtualhost
    <Directory />
        Options -Indexes +FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
    ProxyPreserveHost On
    ProxyVia Full
    <Proxy *>
          Require all granted
    </Proxy>
       ProxyPass / http://172.17.0.2:9090/
       ProxyPassReverse /  http://172.17.0.2:9090/
       ErrorLog /var/log/apache2/local.kide-error.log
       LogLevel error
       CustomLog /var/log/apache2/local.kide-access.log combined
</VirtualHost>

当我http://terminal.local从浏览器访问时出现此错误:

WebSocket 与 'ws://terminal.local/websocket' 连接失败:WebSocket 握手期间出错:意外响应代码:400

我应该做些什么?

以下是错误日志:

[Mon Jun 25 16:13:43.072784 2018] [proxy:error] [pid 14905:tid 139981405693696] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:9090 (127.0.0.1) failed 
[Mon Jun 25 16:13:43.072892 2018] [proxy:error] [pid 14905:tid 139981405693696] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s 
[Mon Jun 25 16:13:43.072900 2018] [proxy_http:error] [pid 14905:tid 139981405693696] [client 127.0.0.1:34494] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 
[Mon Jun 25 16:13:43.486626 2018] [proxy:error] [pid 14905:tid 139981397300992] AH00940: HTTP: disabled connection for (127.0.0.1) 
[Mon Jun 25 16:57:24.538726 2018] [proxy:error] [pid 1954:tid 140063423616768] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:9090 (127.0.0.1) failed
[Mon Jun 25 16:57:24.688176 2018] [proxy:error] [pid 1954:tid 140063423616768] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s 
[Mon Jun 25 16:57:24.688220 2018] [proxy_http:error] [pid 1954:tid 140063423616768] [client 127.0.0.1:45860] AH01114: HTTP: failed to make connection to backend: 127.0.0.1 
[Mon Jun 25 16:57:25.290133 2018] [proxy:error] [pid 1954:tid 140063406831360] AH00940: HTTP: disabled connection for (127.0.0.1)

相关内容