Assistance Requested: Accessing NextCloud After Initial Setup - Docker - NGINX - AIO

The Basics

  • NextCloud AIO Docker Image Latest version
  • Host PC macOS Tahoe 26.2

The Problem:

Hoping someone can please help as I’ve been stuck on this for about a week and I have troubleshot this like crazy. I had a different version of NextCloud succesfully running on my network for the last several weeks. I wanted to switch to the AIO image. I have a brand new computer where I’m trying to install it on. I was trying to setup the AIO, but I am completely stuck with the setup. I’ve scoured the internet for documentation of yml parameters for AIO setup, but could not find anything. I’m trying to setup to with NGINX reverse proxy. I have been unable to get that to function. I think the issue is networking between docker containers, but uncertain what this issue might be. I’ve been trying to rule that out as an issue, but I am unable to locally connect to the nextcloud system from the host PC.

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

Factory Reset Docker Data on Mac OS Docker under Troubleshoot | Reset to Factory Defaults

Run command: docker network create nginx-proxy

Run command: docker network ls to confirm network created

My Nginx docker-compose.yml file contents:

services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy:latest
    container_name: nginx-proxy
    networks:
      - nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./conf:/etc/nginx/conf.d
      - ./vhost:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html
      - ./certs:/etc/nginx/certs   # MUST be writable
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: unless-stopped

  acme-companion:
    image: nginxproxy/acme-companion:latest
    container_name: nginx-proxy-acme
    environment:
      DEFAULT_EMAIL: "XXX@outlook.com"
    networks:
      - nginx-proxy
    volumes_from:
      - nginx-proxy
    volumes:
      - ./certs:/etc/nginx/certs
      - ./acme:/etc/acme.sh
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

networks:
  nginx-proxy:
    external: true
    name: nginx-proxy

While in Nginx folder run command: docker compose up -d

My NextCloud docker-compose.yml

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    container_name: nextcloud-aio-mastercontainer
    restart: unless-stopped

    networks: 
      - nginx-proxy

    ports:
      - "8080:8080"
      - "8443:8443"

    environment:
      SKIP_DOMAIN_VALIDATION: "true"
      APACHE_PORT: "11000" 
      APACHE_IP_BINDING: "0.0.0.0"
      APACHE_DISABLE_REWRITE_IP: 1
      TRUSTED_PROXIES: cloud.XXX.mynetgear.com localhost 127.0.0.1 10.0.1.75
      NEXTCLOUD_TRUSTED_DOMAINS: cloud.XXX.mynetgear.com  127.0.0.1 10.0.1.75 localhost

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

      # Required AIO internal volume (must be named exactly)
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config

      # External data + backups
      - /Volumes/Docker/NextCloud_AIO/data:/mnt/ncdata
      - /Volumes/Docker/NextCloud_AIO/backups:/mnt/backups

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

networks:
  nginx-proxy:
    external: true
    name: nginx-proxy

While in NextCloud AIO folder run command docker compose up -d

Nextcloud-aio-mastercontainer successfully creates

On my host PC, go to localhost:8080 to access setup page.

I’m able to successfully go through setup.

Run command: docker network ls
Displays Nginx and nextcloud-aio networks. Both display as bridge.

All containers successfully created and display as started.

I’m stuck trying to figure out how to access Nextcloud on my location network. I wanted to test that because Nginx proxy does not work to my domain name.

Note: My network firewalls are successfully reaching the NGINX proxy when I use my cloud.XXX.mynetgear.com address.

I tried connecting local host using various methods

10.0.1.75:80 Nginx 503 unavailable.
10.0.1.75:443 Nginx 400 bad request.
http://10.0.1.75:8443 Client sent an HTTP request to an HTTPS server.
https://10.0.1.75:8443 No web page loads.

My Nginx proxy configuration:

server {
  listen [::]:443 ssl http2;
  listen 443 ssl http2;
  server_name cloud.XXX.mynetgear.com;
  root /var/www/html;

  ssl_session_timeout 1d;
  ssl_session_cache shared:SSL:50m;
  ssl_session_tickets off;

  index index.php index.html /index.php$request_uri;

  location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    client_max_body_size 0;
    proxy_pass http://127.0.0.1:443/;
    access_log /var/log/nginx/cloud1.access.log;
    error_log /var/log/nginx/cloud1.error.log;
  }
}

Interesting this is that I noticed that the proxy configurations I enter keep getting cleared out. This did not happen with my previous NextClound (not AIO) docker setup.

Proxy_Pass Notes: I tried ports on 127.0.1.1 - 443, 80, 11000, and 8443 in the above proxy_pass entry. All result in 503 error from Nginx when I browse to cloud.XXX.mynetgear.com

I also tried 172.19.0.13 and 172.19.0.14 on ports 9000 (next cloud) and 11000 (apache).

Run docker ps:
Apache 127.0.0.1:11000->11000/tcp
NextCloud container is running on 9000/tcp

Get the IP address of nextloud container
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ nextcloud-aio-nextcloud
172.19.0.13

Get the IP address of apache container
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ nextcloud-aio-apache
172.19.0.14

Any assistance or ideas would be greatly appreciated. Thank you! :slight_smile:

Agreed that is 1/3 of your obstacles.

Couple things:

  • Refer to the AIO documentation for reverse proxy usage and in particular: On the same server in a Docker container. You will likely be using ii (or possibly iii).
  • Your proxy_pass target will likely be http://nextcloud-aio-apache:11000
  • You’re trying to using the nginx-proxy image which is neither standard Nginx nor one of the other supported Nginx variations (e.g. NPM). Did you see the list of supported reverse proxies? and the bit specifically about the.image you’re trying to use?
  • You seem to be trying to use several environment variables that aren’t for AIO per your Compose file (they’re for a different image/etc). Supported ones can be found in the example Compose file in the AIO repository the above docs are located in. Note though that you’re likely trying to over engineer things so stick to what’s referenced in the AIO RP docs.
  • Your provided Nginx config is not appropriate for a reverse proxy scenario. Again, please see the AIO RP docs where specific examples are provided (once you sort out the appropriate Nginx or other RP image you’ll be using).

References:

3 Likes

thank you for the assist. :slight_smile: I was able to get it running. I want to say that NGINX was like 90% of the issue. I downloaded a different NGINX proxy container. After that, I was able to get most of it going. Ran into some other hiccups along the way, but also sorted those out.

1 Like

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