Need Help Configuring Notify Push in Docker with Caddy

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 33.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.4
  • Web server and version (e.g, Apache 2.4.25):
    • Not Sure
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Caddy 2.11.2
  • PHP version (e.g, 8.3):
    • 8.4.19
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Initial Setup
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Official Docker Container
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I’ve installed the Client Push app in my Nextcloud instance and the corresponding push server via the Docker image provided by icewind1991/notify_push:1.3.1. I added the appropriate handle_path block to my Caddyfile, which appears to be forwarding /push correctly. However, it seems like my push server can’t communicate with Nextcloud. If I run occ notify_push:setup https://nextcloud.example.com/push, the push server debug logs show Received test cookie, but Nextcloud responds with can’t connect to push server ... `404 Not Found`.

DEBUG [notify_push] src/lib.rs:448: Received test cookie 573881099
✓ redis is configured
🗴 can't connect to push server: Client error: `GET https://nextcloud.example.com/push/test/cookie` resulted in a `404 Not Found` response:
<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en" translate="no" >
        <head
  (truncated...)
notify_push:
    container_name: notify_push
    image: icewind1991/notify_push:1.3.1
    environment:
      - PORT=7867
      - NEXTCLOUD_URL=https://nextcloud.example.com
    volumes:
      - ${CONFIG_DIR}/nextcloud:/var/www/html/config
    entrypoint: /notify_push --log-level debug /var/www/html/config/config.php
    restart: unless-stopped
nextcloud.example.com {
	redir /.well-known/carddav /remote.php/dav/ 301
	redir /.well-known/caldav /remote.php/dav/ 301
	header Strict-Transport-Security max-age=31536000;
	handle_path /push/* {
		reverse_proxy http://notify_push:7867
	}
	reverse_proxy nextcloud:80
}

Steps to replicate it (hint: details matter!):

  1. Install Client Push app

  2. Configure push server in Docker: icewind1991/notify_push:1.3.1

  3. Run docker exec -it nextcloud php occ notify_push:setup https://nextcloud.example.com/push

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Hello @kensible, welcome to the Nextcloud community! :handshake:

please review following topics for troubleshooting hints

best
@wwe

The 404 on /push/test/cookie is coming from Nextcloud itself, not from notify_push. What this tells you is that Caddy is forwarding the request correctly to notify_push, but when notify_push tries to verify the connection by calling back to Nextcloud at the URL in your NEXTCLOUD_URL environment variable, it cannot reach it or is reaching the wrong service.

The problem is almost certainly your NEXTCLOUD_URL setting. You have it set to https://nextcloud.example.com which is your external public URL. Inside Docker, when notify_push makes a request to that address, the request either goes out to the internet and comes back in through Caddy (which works but is fragile), or the DNS doesn’t resolve correctly from within the container network, or it hits Caddy and something in the routing fails.

The fix is to set NEXTCLOUD_URL to the internal Docker network address of your Nextcloud container:

NEXTCLOUD_URL=http://nextcloud:80

Replace “nextcloud” with the actual container name of your Nextcloud instance (whatever is set in container_name in your Docker Compose). Make sure both containers are on the same Docker network.

You also need to confirm the notify_push container can actually reach Nextcloud internally. From the notify_push container:

docker exec notify_push wget -q -O- http://nextcloud/status.php

That should return a JSON blob with the Nextcloud version. If it fails, the containers are not on the same network.

On the Caddy side, your handle_path block should look like this:

handle_path /push/* {
    reverse_proxy notify_push:7867
}

The handle_path directive in Caddy strips the matched prefix before forwarding, so notify_push receives requests at / not /push/. That part sounds like you have right.

After fixing NEXTCLOUD_URL and restarting the container, run the occ setup command again and it should pass.

I tried using the internal URL and got the same 404 response. I put together a small Dockerfile that adds wget to the image (which only contains the notify push binary), and I can see the JSON response using NEXTCLOUD_URL=http://nextcloud:80, but notify_push:setup still doesn’t work (404).

{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"33.0.1.2","versionstring":"33.0.1","edition":"","productname":"Nextcloud","extendedSupport":false}

I was using the following command to test notify push:

docker exec -it nextcloud php occ notify_push:setup https://nextcloud.example.com/push

By swapping to http://nextcloud/push, I was able to get the correct response, but I can’t use my external domain. I put Nextcloud behind Authelia via the OpenID Connect user backend app. Is that perhaps causing the issue?

✓ redis is configured
🗴 using unencrypted http for push server is strongly discouraged
✓ 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

I also tried downloading the test client to another PC (and created an app password for authentication). I get back “Found push server” but “Can’t connect to server.”

C:\Users\...\Downloads\test_client-x86_64-pc-windows-gnu.exe https://nextcloud.example.com <username> <app-password>
[2026-04-01 13:43:20.902916 -04:00] INFO [test_client] test_client/src/main.rs:39: Found push server at ws://notify_push:7867/push/ws
Error:   × Can't connect to server
  ├─▶ IO error: No such host is known. (os error 11001)
  ╰─▶ No such host is known. (os error 11001)

in your last attempt you used internal hostname and both containers can talk to each other.. but the “external” client can not because there is no host notify_push in your LAN:

this tells you nextcloud container for some reason can talk to http://nextcloud/push but can not talk to https://nextcloud.example.com/push. you must check the networking - DNS, routing, firewall, reverse proxy to see where this request fails.. once you solve the issue it should start working..

I thought that was the point of adding this block to Caddy:

handle_path /push/* {
    reverse_proxy notify_push:7867
}

I realized that I misspoke in my last reply. I think the reason the test client is using ws://notify_push:7867/push/wsis because I ran the following setup command to test the Docker network communication:

docker exec -it nextcloud php occ notify_push:setup http://notify_push:7867/push

This, of course, configured Nextcloud to use http://notify_push:7867/pushas the push server. I can’t, however, run the setup command with https://nextcloud.example.com/push

I feel so stupid… I resolved the issue. I very recently wrote a Dockerfile that uses Caddy as the base image and adds geoblocking via the caddy-maxmind-geolocation plugin. I forgot that I had moved my Caddyfile to the folder where I put the Dockerfile. I didn’t delete my old Caddyfile, so I’ve been updating the wrong one this whole time. After adding some debug log directives to the file, I figured it out.