Bad gateway after successfully getting the domain working

So I’ve been trying to get this working for like 4 hours. I’m frustrated and I don’t know what I need to change in order to make it work.

so I used this template from the Nginx Proxy Manager site:

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      # These ports are in format <host-port>:<container-port>
      - '80:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      # Mysql/Maria connection parameters:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
      # Uncomment this if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
    depends_on:
      - db

  db:
    image: 'jc21/mariadb-aria:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./mysql:/var/lib/mysql

I started it by running:

docker compose up -d

Afterwards the container is up running. The next think I did was to follow the guide on:

https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md

I was able to login into the manager by typing in my ip:81

I followed up by configuring the Proxy Manager UI the EXACT same way as it’s being shown in the images with http, localhost, port 110000 and all the other settings in the picture only exception adding my domain name. domainname → localhost → port 11000

Unfortunately when I clicked on “save” I got an internal error. Seems like some problems with SSL?!

Nevertheless I did continue with following command:

sudo docker run \
--sig-proxy=false \
--name nextcloud-aio-mastercontainer \
--restart always \
--publish 8080:8080 \
--env APACHE_PORT=11000 \
--env APACHE_IP_BINDING=0.0.0.0 \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest

Lucky and it felt really good I was able to access my AIO by entering my domain which had an a record to my VPS ip.

I’m stuck at this point trying to enter my domain. I entered it (I was also able to access it by the browser bar) but I got the error message:

Domain does not point to this server or the reverse proxy is not configured correctly. See the mastercontainer logs for more details. ('sudo docker logs -f nextcloud-aio-mastercontainer')

I don’t know how to fix that unfortunately.

Update:
I was able to get the domain working by adding the nextcloud-aio-domaincheck container into my Nginx Proxy Manager. Unfortunately when the installation finishes I get a “Bad Gateway” and I don’t know how to fix that.

Here a the steps I did:

  1. I had the error
  2. I fixed it by adding the Domaincheck container into my Nginx Proxy Manager
    nextcloud-aio-domaincheck - 2
  3. The installation finished successfully:
    After Installation

But now, when I click on “open Nextcloud” I receive a bad gateway error. Do I have to add other containers to the Nginx Proxy Manager? Which Ports do I have to forward?

when I open my domain I receive the following:

Bad Gateway

Hi, you probably now need to point nginx-proxy-manager at the nextcloud-aio-apache container to fix this (because the domaincheck conntainer is substituted by the apache container after thte initial setup).