# WebSocket seems to be disconnected

**URL:** <https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105>\
**Category:** Pydio Cells\
**Created:** [October 26, 2021, 11:43am UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105 "2021-10-26T11:43:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [October 26, 2021, 11:43am UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/1 "2021-10-26T11:43:24Z")

</div>

Hi,  
I’ve installed pydio cells on apache server. After logging in successfully I see ’ Internal server’ error at the bottom.  
and I see this error on the left **Websocket seems to be disconnected, please make sure that the server is up and websocket connection is working**  
Can anyone help please?

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [October 26, 2021, 1:04pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/2 "2021-10-26T13:04:07Z")

</div>

Hello @Nayrouz_Boussoffara ,

It might be related to your reverse proxy configuration, maybe the websocket is not handled by apache, it needs a specific line on the configuration to allow it to proxy the websocket.

Could you share your current apache configuration ?

---

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [October 26, 2021, 1:08pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/3 "2021-10-26T13:08:32Z")

</div>

Thank you @zayn for your reply.  
this is my configuration file

```auto
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName elab.diginov.tech
DocumentRoot /var/www/html/pydio/
ErrorLog ${APACHE_LOG_DIR}/pydioerror.log
CustomLog ${APACHE_LOG_DIR}/pydioaccess.log combined
Header set Access-Control-Allow-Origin "*"
AllowEncodedSlashes On
SSLProxyEngine On
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
ProxyPassMatch "/ws/(.*)" wss://elab.diginov.tech:8080/ws/$1 nocanon
ProxyPass / https://elab.diginov.tech:8080/ nocanon
ProxyPassReverse / https://elab.diginov.tech:8080/ nocanon
RewriteEngine on
RewriteCond %{SERVER_NAME} =elab.diginov.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName elab.diginov.tech
DocumentRoot /var/www/html/pydio/
ErrorLog ${APACHE_LOG_DIR}/pydioerror.log
CustomLog ${APACHE_LOG_DIR}/pydioaccess.log combined
Header set Access-Control-Allow-Origin "*"
AllowEncodedSlashes On
SSLProxyEngine On
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
ProxyPassMatch "/ws/(.*)" wss://elab.diginov.tech:8080/ws/$1 nocanon
ProxyPass / https://elab.diginov.tech:8080/ nocanon
ProxyPassReverse / https://elab.diginov.tech:8080/ nocanon
SSLCertificateFile /etc/letsencrypt/live/elab.diginov.tech/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/elab.diginov.tech/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

```

---

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [October 26, 2021, 1:10pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/4 "2021-10-26T13:10:19Z")

</div>

Hi Thank you @zayn for your replyy.  
this is my configuration file

```auto
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName elab.diginov.tech
DocumentRoot /var/www/html/pydio/
ErrorLog ${APACHE_LOG_DIR}/pydioerror.log
CustomLog ${APACHE_LOG_DIR}/pydioaccess.log combined
Header set Access-Control-Allow-Origin "*"
AllowEncodedSlashes On
SSLProxyEngine On
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
ProxyPassMatch "/ws/(.*)" wss://elab.diginov.tech:8080/ws/$1 nocanon
ProxyPass / https://elab.diginov.tech:8080/ nocanon
ProxyPassReverse / https://elab.diginov.tech:8080/ nocanon
RewriteEngine on
RewriteCond %{SERVER_NAME} =elab.diginov.tech
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName elab.diginov.tech
DocumentRoot /var/www/html/pydio/
ErrorLog ${APACHE_LOG_DIR}/pydioerror.log
CustomLog ${APACHE_LOG_DIR}/pydioaccess.log combined
Header set Access-Control-Allow-Origin "*"
AllowEncodedSlashes On
SSLProxyEngine On
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
ProxyPassMatch "/ws/(.*)" wss://elab.diginov.tech:8080/ws/$1 nocanon
ProxyPass / https://elab.diginov.tech:8080/ nocanon
ProxyPassReverse / https://elab.diginov.tech:8080/ nocanon
SSLCertificateFile /etc/letsencrypt/live/elab.diginov.tech/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/elab.diginov.tech/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

```

---

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [October 26, 2021, 1:30pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/5 "2021-10-26T13:30:10Z")

</div>

this is also a screenshot from my pydio log

 ![MicrosoftTeams-image (39)](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/8/8e4dd7422fbc1bac5e38a992c6e6ee4721fd1558.png)

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [October 26, 2021, 4:10pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/6 "2021-10-26T16:10:11Z")

</div>

Hello @Nayrouz_Boussoffara

Your configuration has the correct directives, maybe the virtual host 80 & 443 directives are conflicting,  
I would advise you to use a configuration that redirects 80 to 443 without having to duplicate the code (see below).

```auto
<VirtualHost *:80>
	ServerName my-cells-server.com
	RewriteEngine On
	RewriteCond %{HTTPS} off
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    RewriteCond %{SERVER_NAME} =my-cells-server.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
	ServerName my-cells-server.com
	AllowEncodedSlashes On
	RewriteEngine On

    SSLProxyEngine On
    
	ProxyPassMatch "/ws/(.*)" wss://localhost:8080/ws/$1 nocanon
    ProxyPass "/" "https://localhost:8080/"
	ProxyPassReverse "/" "https://localhost:8080/"
	

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	SSLCertificateFile /etc/letsencrypt/live/my-cells-server.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/my-cells-server.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

```

By the way while reading your configuring I noticed that your are redirecting to the same domain under a different port, is it required for your use case ?

Can you setup Cells without a reverse proxy ?

Could you also tell me what configuration Cells is running with, you can use `./cells configure sites` to retrieve the list.

---

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [October 27, 2021, 2:57pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/7 "2021-10-27T14:57:53Z")

</div>

Hello,  
Regarding the redirection we’re redirecting to the same domain because we’re using the ssl certificate with that domain. We tried port 443 and disabled apache it didnt work.

We did setup Cells without a reverse proxy but same issue.

This is our configuration, we changed to port 9000:

 ![MicrosoftTeams-image (40)](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/4/4ef44791c864190b2a47e3a60b008bb0537e66e9.png)

By the way we tried the configuration file you recommended but didnt work too.

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [October 27, 2021, 3:16pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/8 "2021-10-27T15:16:28Z")

</div>

Could you try with one of the following solutions and see if it is working ?

## 1) Without Apache

If you can avoid using Apache, this configuration is adapted to the case.

Disable Apache and configure Cells like this:

```auto
pydio@debian:~$ ./cells configure sites
The following sites are currently defined:
+---+-------------------------------------------------+--------------+--------------+
| # | BIND(S) | TLS | EXTERNAL URL |
+---+-------------------------------------------------+--------------+--------------+
| 0 | https://cells-example.com:443 | Lets Encrypt | |
+---+-------------------------------------------------+--------------+--------------+

```

## 2) With Apache

Otherwise if you want to keep Apache, I would suggest this configuration:

On Cells you set the sites like this:

```auto
pydio@debian:~$ ./cells configure sites
The following sites are currently defined:
+---+-------------------------------------------------+--------------+---------------------------------------------+
| # | BIND(S) | TLS | EXTERNAL URL |
+---+-------------------------------------------------+--------------+---------------------------------------------+
| 1 | https://localhost:8080 | Self-signed | https://cells-example.com.eu |
+---+-------------------------------------------------+--------------+---------------------------------------------+

```

And then on Apache reverse proxy config will look like this:

```auto
pydio@debian:~$ cat /etc/apache2/sites-available/cells.conf
<VirtualHost *:80>
    ServerName cells-example.com

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    RewriteCond %{SERVER_NAME} =cells-example.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    ServerName cells-example.com
    AllowEncodedSlashes On
    RewriteEngine On
    SSLProxyEngine On

    ## The order of the directives matters.
    # If Cells is not running with https, consider using ws instead of wss
    ProxyPassMatch "/ws/(.*)" wss://localhost:8080/ws/$1 nocanon

    ## This rewrite condition is required if using Cells-Sync
    RewriteCond %{HTTP:Content-Type} =application/grpc [NC]
    RewriteRule /(.*) h2://localhost:8080/$1 [P,L]

    ProxyPass "/" "https://localhost:8080/"
    ProxyPassReverse "/" "https://localhost:8080/"

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    SSLCertificateFile /etc/letsencrypt/live/cells-example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/cells-example.com/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

```

This configuration is the same that I have on my server, if it still does not work, take a look at your firewall or network settings.

---

<div class="post-metadata">

**Author:** ![Nayrouz\_Boussoffara](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/nayrouz_boussoffara/32/1549_2.png) [@Nayrouz\_Boussoffara](https://forum.pydio.com/u/Nayrouz_Boussoffara)\
**Post date:** [November 3, 2021, 9:57am UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/9 "2021-11-03T09:57:04Z")

</div>

Hi Zayn,  
This didn’t work as well.  
We installed it on a new machine (Ubuntu 20 and Debian 10) without firewall or any specific network settings.  
We also tried it without apache and reverse proxy but the socket issue is always there.  
We installed the official version and the github version but same result.

 ![MicrosoftTeams-image (41)](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/1/11f82b145129f1615dbb267b0061bdeb58df4cb0.png)

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [November 3, 2021, 4:26pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/10 "2021-11-03T16:26:34Z")

</div>

Hello @Nayrouz_Boussoffara,

when you reinstalled, did you make sure to clear the database and remove the config under `~/.config/pydio/cells` your log seems to indicate that you ran multiple versions of Cells.

What type of server are you running, that is indeed weird that even without Apache the websocket does not work.

---

<div class="post-metadata">

**Author:** ![AndyS](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/andys/32/1480_2.png) [@AndyS](https://forum.pydio.com/u/AndyS)\
**Post date:** [November 19, 2021, 12:09pm UTC](https://forum.pydio.com/t/websocket-seems-to-be-disconnected/4105/11 "2021-11-19T12:09:28Z")

</div>

You don’t mention anything about your gateway or firewall, but in our case, I wasted a load of time server side only to find out that it was the firewall blocking WebSockets, the solution was simple in the end (of course WS needs to be enabled on your server too), you may have a different setup of course…

> [@Websocket Error on W2016 IIS](https://forum.pydio.com/t/websocket-error-on-w2016-iis/3963/15):
>
> OK so finally got round to solving this one and it was the firewall in the end, WS(S) are not forwarded by default and have to be added/enabled to the Path-specific Routing rule: Of course anyone else experiencing this issue may have a different firewall solution/setup so have to adapt to their setup. In this instance it is a Sophos solution so the relevant info came via this post: [https://community.sophos.com/sophos-xg-firewall/f/discussions/84592/when-will-websocket-be-supported/3…](https://community.sophos.com/sophos-xg-firewall/f/discussions/84592/when-will-websocket-be-supported/387726#387726)
