# Websocket in NGINX for Nextcloud behind NginX Proxy Manager

**URL:** <https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529>\
**Category:** ℹ️ Support\
**Tags:** docker, notify\_push, nginx\
**Created:** [January 12, 2026, 12:13pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529 "2026-01-12T12:13:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 12, 2026, 12:13pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/1 "2026-01-12T12:13:51Z")

</div>

Hi, I am running a Nextcloud instance at home.

My Setup is:

Fritzbox → Portforwarding 80&443 to NginxProxyManager –\> Proxy Host created forarding Traffic via Port 80 to my Nextcloud Container. In the container nextcloud is run ning in the subfolder /nextcloud

Everything is working, but in the webbrowser I can see an error in the console:

index.js:91 WebSocket connection to ‘wss://servername.fqdn/nextcloud/push/ws’ failed:

In NGINX NPM i have created the following entry:

 ![image](https://help.nextcloud.com/uploads/default/original/3X/3/9/39fb4f9f01a10202e5207f8279da70dd004160cc.png)

 ![image](https://help.nextcloud.com/uploads/default/original/3X/b/7/b7570a66b6bf755e1f529c020b2be54710cdf191.png)

 ![image](https://help.nextcloud.com/uploads/default/original/3X/8/4/848c39eb6684fe424c65dcc3b238c04434dd4f62.png)

What else do I need to do to get this error message away? Some of the settings I had to set otherwise my IOS Devices were not able to connect any longer.

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [January 12, 2026, 1:57pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/2 "2026-01-12T13:57:56Z")

</div>

Hi @wagnbeu0,

Unfortunatley you bypassed the [support template](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402), so important information is still missing.

> [@wagnbeu0](#):
>
> In NGINX NPM i have created the following entry

To know for sure if your setup is correct, you need to explain exactly where and how [your notify\_push service](https://github.com/nextcloud/notify_push) is running. How are your containers orchestrated?

Your information is far too superficial, because even the smallest details matter in this area.

* * *

ernolf

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [January 12, 2026, 2:11pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/3 "2026-01-12T14:11:42Z")

</div>

@wagnbeu0 you’re not giving us much to go on to help you figure this out… did you have a look at the developers instructions?

> **[GitHub - nextcloud/notify\_push: Update notifications for nextcloud clients](https://github.com/nextcloud/notify_push?tab=readme-ov-file#reverse-proxy%23)**
>
> Update notifications for nextcloud clients

especially the troubleshooting section:

> **[GitHub - nextcloud/notify\_push: Update notifications for nextcloud clients](https://github.com/nextcloud/notify_push?tab=readme-ov-file#troubleshooting)**
>
> Update notifications for nextcloud clients

double check your trusted proxies as this is usually the part that is relevant

you’re not a snap user, that’s clear… but the snap wiki might give you a nudge in the right direction: [HPB client-push configuration](https://github.com/nextcloud-snap/nextcloud-snap/wiki/Configure-HPB-client-push-for-Nextcloud-snap)

---

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 12, 2026, 3:05pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/4 "2026-01-12T15:05:35Z")

</div>

I tried to download now the testclient which is giving more information:

`test_client-x86_64-pc-windows-gnu.exe ``https://webserver.example.com/nextcloud`` benjamin PASSWORD`  
`[2026-01-12 16:00:40.153061 +01:00] INFO [test_client] test_client/src/main.rs:39: Found push server at wss://webserver.example.com/nextcloud/push/ws`  
`Error: x Can’t connect to server`  
`|-> URL error: URL scheme not supported`  
``-> URL scheme not supported`

On the server itseld the test is successful:

`sudo -u www-data php /var/www/html/nextcloud/occ notify_push:self-test`  
`✓ redis is configured`  
`✓ push server is receiving redis messages`  
`✓ push server can load mount info from database`  
`✓ push server can connect to the Nextcloud server`  
`✓ push server is a trusted proxy`  
`✓ push server is running the same version as the app`

So I believe i have to tell NGINX as reverse proxy to forward the WSS or WS scheme - but I have no clue how …

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [January 12, 2026, 3:13pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/5 "2026-01-12T15:13:59Z")

</div>

> [@wagnbeu0](#):
>
> `Found push server at wss://webserver.example.com/nextcloud/push/ws`  
> `Error: x Can’t connect to server`

add 127.0.0.1 to trusted proxies in `config.php`… its a local trusted proxy and does not need to forward anything publicly

check this out for NPM configuration, once again, you’re not using the snap that’s clear, but the wiki may nudge you in the correct direction:

> **[NGINX proxy manager](https://github.com/nextcloud-snap/nextcloud-snap/wiki/NGINX-proxy-manager)**
>
> ☁️📦 Nextcloud packaged as a snap. Contribute to nextcloud-snap/nextcloud-snap development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 12, 2026, 3:27pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/6 "2026-01-12T15:27:45Z")

</div>

It is already here:

`sudo -u www-data php /var/www/html/nextcloud/occ config:system:get trusted_proxies`  
`127.0.0.1`  
`::1`  
`192.168.10.8`  
`192.168.10.5`  
`192.168.10.25`

I remember that before I was switching to NGINX Proxy Manager I setup my Router to forward Port 80 to my Nextcloud Apache Webserver - there it worked. Now with using NPM it seems that I am only allowed to specify HTTP and HTTPS as protocoll, so this might show why in my backend no client is connected:

`sudo -u www-data php /var/www/html/nextcloud/occ notify_push:metrics`  
`Active connection count: 0`  
`Active user count: 0`  
`Total connection count: 0`  
`Total database query count: 9`  
`Events received: 1518`  
`Messages sent: 0`  
`Messages sent (file): 0`  
`Messages sent (notification): 0`  
`Messages sent (activity): 0`  
`Messages sent (custom): 0`

---

<div class="post-metadata">

**Author:** ![scubamuc](https://help.nextcloud.com/user_avatar/help.nextcloud.com/scubamuc/32/63165_2.png) [@scubamuc](https://help.nextcloud.com/u/scubamuc)\
**Post date:** [January 12, 2026, 3:35pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/7 "2026-01-12T15:35:18Z")

</div>

![907309b8-076a-4457-b519-eb63381802ff](https://help.nextcloud.com/uploads/default/original/3X/b/b/bb6784b36bda1d7a2c07b9ace4cc3ef1489429f5.png)

---

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 12, 2026, 3:50pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/8 "2026-01-12T15:50:28Z")

</div>

@scubamuc Unfortunately this does not help, its already set.

---

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 12, 2026, 5:16pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/9 "2026-01-12T17:16:24Z")

</div>

OK, I got it fixed.

The challenge was that with one setting the notify\_push service was working, but IOS Devices were no longer able to connect. Modifying the settings then resulted in the ability of IOS clients to connect but client\_pus did not work.

this was my solution:

In NGINX Proxy Manager on my “Proxy Host” pointing to my nextcloud server I removed all existing custom locations. For this Proxy Host i addede the following custom Configuration:

proxy\_pass\_header X-Transmission-Session-Id;  
proxy\_set\_header X-Forwarded-Host $host;  
proxy\_set\_header X-Forwarded-Server $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
#proxy\_hide\_header Upgrade;  
proxy\_read\_timeout 3200;  
proxy\_connect\_timeout 3200;  
client\_max\_body\_size 0;

On the Nextcloud Server I edited the local apache config /etc/apache2/sites-enabled/001-nextcloud.conf and added the following lines at the end of the VirtualHost section:

```auto
        # ProxyPass for Notify_Push
        ProxyPass /nextcloud/push/ws ws://127.0.0.1:7867/ws
        ProxyPassReverse /nextcloud/push/ws ws://127.0.0.1:7867/ws

        ProxyPass /nextcloud/push/ http://127.0.0.1:7867/
        ProxyPassReverse /nextcloud/push/ http://127.0.0.1:7867/

        # ProxyPass for Whiteboard
        ProxyPass /whiteboard/ http://192.168.10.25:3002

        # ProxyPass for browser
        ProxyPass /browser http://192.168.10.25:9983

```

Then I enabled the following modules for the Apache Webserverand restarted the Apache Webserver

`sudo a2enmod proxy`  
`sudo a2enmod proxy_http`  
`sudo a2enmod proxy_wstunnel`

Now its working. My IOS Devices can connect again _and_ my Client\_push is also working.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [January 12, 2026, 6:27pm UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/10 "2026-01-12T18:27:28Z")

</div>

> [@wagnbeu0](#):
>
> What else do I need to do to get this error message away?

In your 3rd screen shot you have an explicit handler in Nginx/NPM for `location ^~ /nextcloud/push/ws/`. That’s the culprit in your original configuration. Nginx doesn’t need that, plus the one you have is pointed at the root of notify\_push (instead of `[...]7867/ws`) which wouldn’t be right anyhow.

You can see the documentation that covers this [here](https://github.com/nextcloud/notify_push?tab=readme-ov-file#nginx).

---

<div class="post-metadata">

**Author:** ![wagnbeu0](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wagnbeu0/32/11170_2.png) [@wagnbeu0](https://help.nextcloud.com/u/wagnbeu0)\
**Post date:** [January 13, 2026, 10:52am UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/11 "2026-01-13T10:52:25Z")

</div>

One more thing:  
My whole setup is not working, when I enable “HTTP/2” in the NGINX ProxyManager. Then the IOS Devices can not connect again. Any Idea how this can be?

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [January 21, 2026, 10:53am UTC](https://help.nextcloud.com/t/websocket-in-nginx-for-nextcloud-behind-nginx-proxy-manager/238529/12 "2026-01-21T10:53:18Z")

</div>

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