# High Performance Backend for Files and Reverse Proxy on seperate Server

**URL:** <https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452>\
**Category:** ℹ️ Support\
**Tags:** reverseproxy, notify\_push, nc21\
**Created:** [February 28, 2021, 11:28pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452 "2021-02-28T23:28:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [February 28, 2021, 11:28pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/1 "2021-02-28T23:28:28Z")

</div>

![Capture](https://help.nextcloud.com/uploads/default/original/3X/0/b/0b0f875585571bf24ee7804a565c1583e584c541.png)  
The wizard for the nextcloud high performance backend only shows how to do it for single server instances where the nextcloud server / web server / reverse proxy and push daemon are on the same server. It otherwise points to [GitHub - nextcloud/notify\_push: Update notifications for nextcloud clients](https://github.com/nextcloud/notify_push).

In my setup the nginx reverse proxy is on it’s own server. I’m confused as to how to setup the high performance backend for this type of setup.

I’m mostly confused as to where to place this nginx code block?

Nginx

If you’re using nginx, add the following location block the the existing server block of the nextcloud server.

location /push/ {  
proxy\_pass [http://127.0.0.1:7867/;](http://127.0.0.1:7867/;)  
proxy\_http\_version 1.1;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection “Upgrade”;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
}

Is the proper place on the nginx reverse proxy or on the nginx web server on my nextcloud server? Or both?

Perhaps, on the reverse proxy do this?  
location / {  
set $upstream\_app ip\_address\_of\_nc\_server;  
set $upstream\_port 7867;

Thanks in advance!

---

<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:** [March 1, 2021, 7:11am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/2 "2021-03-01T07:11:20Z")

</div>

I would say: you have one webserver up and running, and the new notify\_push\_service on the Nextcloud Server. So on the existing webserver you forward to the push\_service. In your case the IP is then not 127.0.0.1 but the right IP from your existing Nextcloud server.

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 1, 2021, 5:35pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/3 "2021-03-01T17:35:54Z")

</div>

wagnbeu0, sorry I don’t quite understand what you’re saying. Can you please try again with additional detail. Thank you.

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 1, 2021, 8:45pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/4 "2021-03-01T20:45:24Z")

</div>

I have 2 nginx web servers running. One on the nextcloud server and another on the reverse proxy. They are two separate physical servers.

---

<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:** [March 2, 2021, 7:13am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/5 "2021-03-02T07:13:14Z")

</div>

I would try the following:

**On the Reverse Proxy Webserver**

location /push/ {  
proxy\_pass http://IP\_of\_NC Webserver:7867/;  
proxy\_http\_version 1.1;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection “Upgrade”;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
}

**On the Nextcloud Webserver:**  
location /push/ {  
proxy\_pass [http://127.0.0.1:7867/;](http://127.0.0.1:7867/;)  
proxy\_http\_version 1.1;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection “Upgrade”;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
}

Typically on the NC webserver the /push should not be needed because the incoming traffic for the nextcloud /push folder will be redirected to the running service. What looks your revery proxy like like?

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 2, 2021, 9:27pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/8 "2021-03-02T21:27:15Z")

</div>

Ufw, opened port 7867 on nc server. Also did a port scan and port is open and accessible from other hosts nc -zv 192.168.XXX.XX 7867 Connection to 192.168.XXX.XX 7867 port [tcp/\*] succeeded!.

Then tried your suggested code blocks. Tested with Talk and User not receiving any notifications.

---

<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:** [March 3, 2021, 7:11am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/9 "2021-03-03T07:11:21Z")

</div>

So, i changed the lines, there was a ip-entry which was marked out …  
On the reverse proxy you forward to the NC server with its IP, and on the NC server to local IP. Can you try it?

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 7:33am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/10 "2021-03-03T07:33:31Z")

</div>

I tried it with the line you changed. Yes, I noticed you omitted the ip of the nc server so I added it appropriately. Users still not receiving notifications.

---

<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:** [March 3, 2021, 8:52am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/11 "2021-03-03T08:52:19Z")

</div>

which notification re you expecting?

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 5:41pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/12 "2021-03-03T17:41:40Z")

</div>

When user 1 starts a conversation with user 2, user 2 should receive a notification. When user 1 sends a chat message to user 2 or vise versa, each user should receive a notification. When user 1 mentions user 2 or vice versa, they should receive notifications.

---

<div class="post-metadata">

**Author:** ![szaimen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/szaimen/32/63019_2.png) [@szaimen](https://help.nextcloud.com/u/szaimen)\
**Post date:** [March 3, 2021, 5:46pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/13 "2021-03-03T17:46:44Z")

</div>

Are you using the android app?

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 5:47pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/14 "2021-03-03T17:47:55Z")

</div>

Android app, IOS app and logged in on browser. No notifications on any device.

---

<div class="post-metadata">

**Author:** ![szaimen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/szaimen/32/63019_2.png) [@szaimen](https://help.nextcloud.com/u/szaimen)\
**Post date:** [March 3, 2021, 5:50pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/15 "2021-03-03T17:50:50Z")

</div>

Afaik, the android and ios apps don’t use the high performance backend. They are using a different system for push notifications. But why it doesn’t work in your browser is a riddle. Sounds like something is misconfigured on your server to me.

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 5:52pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/16 "2021-03-03T17:52:21Z")

</div>

That’s entirely possible, but all tests passed:

sudo -u www-data php 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

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 5:53pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/17 "2021-03-03T17:53:32Z")

</div>

Yes, I believe you are correct that the mobile apps don’t use the notify push service. I had rec’d notifications prior to NC 21 and setting up the notify push service. All notifications broke upon NC 21 with notify push

---

<div class="post-metadata">

**Author:** ![szaimen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/szaimen/32/63019_2.png) [@szaimen](https://help.nextcloud.com/u/szaimen)\
**Post date:** [March 3, 2021, 5:54pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/18 "2021-03-03T17:54:49Z")

</div>

I guess in this case you should report this on github to make sure that the testrun gets improved.

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 5:55pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/19 "2021-03-03T17:55:34Z")

</div>

I have, but sadly the dev has been mostly unresponsive

---

<div class="post-metadata">

**Author:** ![szaimen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/szaimen/32/63019_2.png) [@szaimen](https://help.nextcloud.com/u/szaimen)\
**Post date:** [March 3, 2021, 5:58pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/20 "2021-03-03T17:58:19Z")

</div>

Would you be able to link the issue so that it doesn’t get lost?

---

<div class="post-metadata">

**Author:** ![flotillaropes](https://help.nextcloud.com/letter_avatar/flotillaropes/32/6_22734026db12803ebb3e059622ac3534.png) [@flotillaropes](https://help.nextcloud.com/u/flotillaropes)\
**Post date:** [March 3, 2021, 6:09pm UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/21 "2021-03-03T18:09:47Z")

</div>

I didn’t link it to this post. This is the link to gibhub [Setup successfullly, but users not receiving notifications · Issue #50 · nextcloud/notify\_push · GitHub](https://github.com/nextcloud/notify_push/issues/50)

---

<div class="post-metadata">

**Author:** ![chrissi55](https://help.nextcloud.com/user_avatar/help.nextcloud.com/chrissi55/32/4286_2.png) [@chrissi55](https://help.nextcloud.com/u/chrissi55)\
**Post date:** [April 10, 2021, 10:13am UTC](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452/22 "2021-04-10T10:13:10Z")

</div>

I think i have a similar problem too.

First my config  
NC Server on cloudserver  
ubuntu 20.04.2  
PHP 8.0.3  
PostgreSQL 13.2  
Nginx 1.19.x

Reverse Proxy on RevProxy  
RaspberryPi4 with ubuntu server 20.04.2  
nginx 1.18.x

In RevProxy i entered the following lines to my /etc/nginx/conf.d/cloud.conf

> ```
> location /push/ {
> proxy_pass http://$upstream:7867/;
> proxy_http_version 1.1;
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "Upgrade";
> proxy_set_header Host $host;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }
> 
> ```

set $upstream LOCAL-IP-OF-MY-NC-SERVER

In my /etc/nginx/conf.d/nextcloud.conf on my NC-Server i entered the following lines

> location /push/ {  
> proxy\_pass [https://127.0.0.1:7867/](https://127.0.0.1:7867/);  
> proxy\_http\_version 1.1;  
> proxy\_set\_header Upgrade $http\_upgrade;  
> proxy\_set\_header Connection “Upgrade”;  
> proxy\_set\_header Host $host;  
> proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
> }

I followed this instructure

> **[GitHub - nextcloud/notify\_push: Update notifications for nextcloud clients](https://github.com/nextcloud/notify_push)**
>
> Update notifications for nextcloud clients. Contribute to nextcloud/notify\_push development by creating an account on GitHub.

But when enabling the service i got this error  
(systemctl restart notify\_push, systemctl status notify\_push)

> notify\_push.service - Push daemon for Nextcloud clients  
> Loaded: loaded (/etc/systemd/system/notify\_push.service; enabled; vendor preset: enabled)  
> Active: failed (Result: exit-code) since Sat 2021-04-10 11:56:39 CEST; 11min ago  
> Process: 39178 ExecStart=/var/www/nextcloud/apps/notify\_push/bin/x86\_64/notify\_push /var/www/nextcloud/config/config.php (code=exited, status=1/FAILURE)  
> Main PID: 39178 (code=exited, status=1/FAILURE)
> 
> Apr 10 11:56:39 cloud notify\_push[39178]: 0: Failed to connect to Nextcloud database  
> Apr 10 11:56:39 cloud notify\_push[39178]: 1: error occurred while attempting to establish a TLS connection: InvalidDNSNameError  
> Apr 10 11:56:39 cloud notify\_push[39178]: 2: InvalidDNSNameError  
> Apr 10 11:56:39 cloud notify\_push[39178]: Location:  
> Apr 10 11:56:39 cloud notify\_push[39178]: /tmp/krankerl.CxmLAzrEoja5/notify\_push/src/storage\_mapping.rs:57  
> Apr 10 11:56:39 cloud notify\_push[39178]: Backtrace omitted.  
> Apr 10 11:56:39 cloud notify\_push[39178]: Run with RUST\_BACKTRACE=1 environment variable to display it.  
> Apr 10 11:56:39 cloud notify\_push[39178]: Run with RUST\_BACKTRACE=full to include source snippets.  
> Apr 10 11:56:39 cloud systemd[1]: notify\_push.service: Main process exited, code=exited, status=1/FAILURE  
> Apr 10 11:56:39 cloud systemd[1]: notify\_push.service: Failed with result ‘exit-code’.

Does anybody knows what the error message

`1: error occurred while attempting to establish a TLS connection: InvalidDNSNameError`

and

`2: InvalidDNSNameError`

mean?

My /etc/systemd/system/notify\_push.service looks like

> [Unit]  
> Description = Push daemon for Nextcloud clients
> 
> [Service]  
> Environment = PORT=7867 # Change if you already have something running on this port  
> ExecStart = /var/www/nextcloud/apps/notify\_push/bin/x86\_64/notify\_push /var/www/nextcloud/config/config.php  
> User=www-data
> 
> [Install]  
> WantedBy = multi-user.target

So in fact that i got errors with starting the service i got errors by activating the url

command `sudo -u www-data php /var/www/nextcloud/occ notify_push:self-test`

responsed with  
`🗴 no push server configured`

What to do?

Update: I have to append that i have a working [https://NC-Server](https://NC-Server) config running secured by Let’s Encrypt Certificates (rsa and ecc)  
And Port 7876 is not in use by another service as far i have checked.

[Next page](https://help.nextcloud.com/t/high-performance-backend-for-files-and-reverse-proxy-on-seperate-server/109452.md?page=2)
