# WebSocket connection failed with Apache reverse proxy after upgrading to Cells 4.0.4

**URL:** <https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831>\
**Category:** Pydio Cells\
**Created:** [December 1, 2022, 3:38am UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831 "2022-12-01T03:38:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![laleyan](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@laleyan](https://forum.pydio.com/u/laleyan)\
**Post date:** [December 1, 2022, 3:38am UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/1 "2022-12-01T03:38:10Z")

</div>

Hello,

I’m running Cells behind Apache reverse proxy. Both running on the same CentOS 8 server.  
The Apache is 2.4.37.

I recently upgraded from Cells 3.x to 4.0.4.  
After the upgrade I’m getting an error message at the bottom of the browed UI:  
Connection issue  
Websocket seems to be disconnected, please make sure that the server is up and websocket connection is working.  
 ![image](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/8/8767992111c8942150cfc56d1420e48a5aa355bb.png)

This is my configuration:

```auto
The following sites are currently defined:
+---+------------------------+-------------+----------------------------+
| # | BIND(S) | TLS | EXTERNAL URL |
+---+------------------------+-------------+----------------------------+
| 0 | https://localhost:8181 | Self-signed | https://mypublicdomain.com |
+---+------------------------+-------------+----------------------------+

```

This is my Apache configuration:

```auto
<VirtualHost *:443>
        ServerName mypublicdomain.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:8181/ws/$1 nocanon

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

        ProxyPass "/" "https://localhost:8181/"
        ProxyPassReverse "/" "https://localhost:8181/"

		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>

```

When I hit [https://localhost:8181](https://localhost:8181), everything is working fine including the websockets.  
When I hit [https://mypublicdomain.com](https://mypublicdomain.com) through the Apache reverse proxy, the websockets are not working. Everything was working just fine when before the Cells 3.x to 4.0.4 upgrade.

What can be the issue?

---

<div class="post-metadata">

**Author:** ![laleyan](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@laleyan](https://forum.pydio.com/u/laleyan)\
**Post date:** [December 10, 2022, 9:23pm UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/2 "2022-12-10T21:23:41Z")

</div>

I’m still getting the same error after upgrading to Cells 4.0.5

---

<div class="post-metadata">

**Author:** ![laleyan](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@laleyan](https://forum.pydio.com/u/laleyan)\
**Post date:** [December 12, 2022, 3:45am UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/3 "2022-12-12T03:45:14Z")

</div>

It seems like the self-signed certificate in Cells is the issue because if I turn off TLS on the Cells and change the following lines in the Apache configuration, the websockets are working just fine:

```auto
ProxyPassMatch "/ws/(.*)" ws://localhost:8181/ws/$1 nocanon

ProxyPass "/" "http://localhost:8181/"
ProxyPassReverse "/" "http://localhost:8181/"

```

```auto
+---+------------------------+---- ---+----------------------------+
| # | BIND(S) | TLS | EXTERNAL URL |
+---+------------------------+------ -+----------------------------+
| 0 | https://localhost:8181 | No Tls | https://mypublicdomain.com |
+---+------------------------+------ -+----------------------------+

```

What changed in v4 to cause the websocket issue?

---

<div class="post-metadata">

**Author:** ![c12simple](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/c12simple/32/90_2.png) [@c12simple](https://forum.pydio.com/u/c12simple)\
**Post date:** [December 13, 2022, 9:28am UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/4 "2022-12-13T09:28:55Z")

</div>

Hello,

When you activate self-signed cert, please try following params in reverse proxy settings:

```auto
  SSLProxyVerify None
  SSLProxyCheckPeerCN Off
  SSLProxyCheckPeerName Off

```

---

<div class="post-metadata">

**Author:** ![laleyan](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@laleyan](https://forum.pydio.com/u/laleyan)\
**Post date:** [December 13, 2022, 7:23pm UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/5 "2022-12-13T19:23:59Z")

</div>

Unfortunately, adding those 3 settings in my Apache configuration don’t make any difference. The websocket error remains.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [February 11, 2023, 7:24pm UTC](https://forum.pydio.com/t/websocket-connection-failed-with-apache-reverse-proxy-after-upgrading-to-cells-4-0-4/4831/6 "2023-02-11T19:24:53Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
