outline/outline

WebSocket Connection Failed

ketlinapuci opened this issue · 2 comments

Hello, I am self-hosting an install of outline in docker and the application is accessible via https. I have followed the documentation for setting up the docker compose file and the .env file. After enabling the app I can access those correctly using google auth and OIDC.
When I enter and start creating new documents or new collections. I get this errors in the console:

WebsocketProvider.tsx:73 WebSocket connection to 'wss://knowledge.evolutivo.it/realtime/?EIO=4&transport=websocket' failed: 
WebSocket connection to 'wss://knowledge.evolutivo.it/collaboration/document.826f4953-047c-4cd5-82ad-748d311d4cdc' failed: 

In my case apache manages the domain and certificates and does a proxy to the internal docker service. I have enabled the necessary Apache modules for proxying. In my .env file I have added the WEBSOCKET=true parameter and this is my conf file in apache:

<IfModule mod_ssl.c>

<VirtualHost *:443>
    ServerName knowledge.evolutivo.it
    AllowEncodedSlashes On
    <Directory "/home/knowledgeoutline">
    allow from all
    Options -Indexes
    </Directory>

SSLProxyEngine on
ProxyPreserveHost On
ProxyRequests Off
SSLEngine on
SSLProxyVerify none

ErrorLog "/var/log/apache2/error.log"


ProxyPass /  http://localhost:3000/
ProxyPassReverse /  http://localhost:3000/

SSLCertificateFile /etc/letsencrypt/live/knowledge.evolutivo.it/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/knowledge.evolutivo.it/privkey.pem

</VirtualHost>
</IfModule>

After getting the websocker failed error I tried to adapt my configurations like this:

<IfModule mod_ssl.c>

<VirtualHost *:443>
    ServerName knowledge.evolutivo.it
    AllowEncodedSlashes On
    <Directory "/home/knowledgeoutline">
    allow from all
    Options -Indexes
    </Directory>

SSLProxyEngine on
ProxyPreserveHost On
ProxyRequests Off
SSLEngine on
SSLProxyVerify none

ErrorLog "/var/log/apache2/error.log"


ProxyPass /  http://localhost:3000/
ProxyPassReverse /  http://localhost:3000/

RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:3000/$1" [P,L]

SSLCertificateFile /etc/letsencrypt/live/knowledge.evolutivo.it/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/knowledge.evolutivo.it/privkey.pem
#Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

After changing and enabling the site again, I get the following errors:

ap_proxy_transfer_between_connections: error on origin - ap_pass_brigade
proxy: websocket: client flushing failed (-102)

Is there anything else I should be doing. Could you please help me with this issue?
Thank you

Duplication of #6736, self-hosting configuration issues should be kept in discussions.