Setting up AIO with existing reverse proxy

I run a Linux box at home with Docker, NPM (Nginx Proxy Manager), and many other containers. I want to add Nextcloud and have almost had success with the beautiful AIO package. Ideally, I’d want Nextcloud to just run locally, and then I can let my reverse-proxy publish it. However, AIO tries to do “something” that upsets it, and it won’t work.

Szaimen’s easy-test is successful though obviously not useful except as proof of concept.

Here are my reproducible steps so far. I would appreciate to learn what my next action could be!

  1. NPM is already set up with static IP, domain, and auto-renewed wildcard certificate.
  2. NPM is set to route my Nextcloud sub-domain-tld to my Ubuntu homelab server at 192.168.1.10 port 9028.
  3. Szaimen’s easy-test works (see exact command below); I can log in as admin and use it. That is obviously not useful but it proves that my setup is good so far. I have stopped & removed that again.
  4. AIO starts from a customized docker-compose file, see below.
  5. AIO runs; I can use my domain URL and submit the sub-domain-tld to create a new AIO instance. That seems to work but the next page won’t load.
  6. I replace the browser URL with 192.168.1.10:9028 and again submit the sub-domain-tld to create a new AIO instance. This works.
  7. Now I see the /containers page. I uncheck all optional containers and set the timezone. Then I download and start containers (with Nextcloud 28).
  8. The containers are starting, and eventually it’s ready to go. So far so good!
  9. Portainer tells me all is green and healthy except for nextcloud-aio-domaincheck which is exited. I notice that nextcloud-aio-apache is also mapped to the same port 9028 that the mastercontainer already uses.
  10. The problems start when I click the button Open your Nextcloud↗: It goes to my sub-domain-tld URL but I get a 502 error.
  11. I use Portainer to manually stop nextcloud-aio-apache and refresh the browser. Now I see the Nextcloud AIO Login and enter my passphrase.
  12. I am back at the /containers page (this time on sub-domain-tld!) and see the button Open your Nextcloud↗ again. I’m stuck in a loop here.
  13. The /containers page suggests the Github discussion 2105 which does not apply - there are no Apache container logs because I stopped that container back in step 11.
docker run -it \
-e SERVER_BRANCH=master \
-e TRUSTED_DOMAIN=sub-domain-tld \
--name nextcloud-easy-test \
-p 9028:443 \
--volume="nextcloud_easy_test_npm_cache_volume:/var/www/.npm" \
ghcr.io/szaimen/nextcloud-easy-test:latest
services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    init: true
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
##      - 80:80 # Can be removed when running behind a web server or reverse proxy
      - 9028:8080
##      - 8443:8443 # Can be removed when running behind a web server or reverse proxy
    environment:
      # APACHE_PORT: 11000 # Is needed when running behind a web server or reverse proxy
      APACHE_PORT: 9028
      APACHE_IP_BINDING: 192.168.1.10 # Should be set when running behind a web server or reverse proxy
      NEXTCLOUD_DATADIR: /home/foo/docker/nextcloud-20240614/data
      SKIP_DOMAIN_VALIDATION: 1
      TRUSTED_DOMAIN: sub-domain-tld

Hi, can you follow all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub?

I ended up going with the much simpler docker-compose in linuxserver.io plus mariadb plus redis. That works just fine with my existing reverse proxy.