Nextcloud Proxy Manager with Nextcloud fpm

I am trying to setup Nextcloud with NginX.
For that I tried to make it as simple as possible for me and used the examples from the github page… But I want to use the Nextcloud Proxy Manager, so I chose the insecure example. Would you recommend for me to rather try the secure one and proxy to that?
The MariaDB example was very inconsistent and lost connection/internal errors all the time.
Had to reload 3 times to load a page. With Postgres it works fine now. Maybe someone nows whats going on there? Because I would rather use MariaDB.

Now the current behaviour is that I can access Nextcloud on ip:8080 but I can’t make the proxy work. Running this setup on an external server and opened port 8080/443/80/81.

Here is my docker-compose.yml from git. I had to remove te 172.0.0.1 before the ports because then I couldn’t reach Nextcloud…
(proxy is the external network Nextcloud Proxy Manager and Nextcloud are in.)

version: '3'

services:
  db:
    image: postgres:alpine
    restart: always
    volumes:
      - ./Container-Daten/db:/var/lib/postgresql/data
    env_file:
      - db.env

  redis:
    image: redis:alpine
    restart: always

  app:
    image: nextcloud:fpm-alpine
    restart: always
    volumes:
      - ./Container-Daten/nextcloud/html:/var/www/html
    environment:
      - POSTGRES_HOST=db
      - REDIS_HOST=redis
    env_file:
      - db.env
    depends_on:
      - db
      - redis

  web:
    build: ./web
    restart: always
    ports:
      - 8080:80
    volumes:
      - ./Container-Daten/nextcloud/html:/var/www/html:ro
    depends_on:
      - app

  cron:
    image: nextcloud:fpm-alpine
    restart: always
    volumes:
      - ./Container-Daten/nextcloud/html:/var/www/html
    entrypoint: /cron.sh
    depends_on:
      - db
      - redis


networks:
  default:
    external:
      name: proxy

This is what I have in NginX Proxy Manager. I tried localhost the
image

Here is the NginX Proxy Manager docker-compose.yml:

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    user: 0:0 #uid:gid
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "******************"
      DB_MYSQL_PASSWORD: "***********************"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./Container-Daten/NginXProxyManager/data:/data
      - ./Container-Daten/NginXProxyManager/letsencrypt/data:/etc/letsencrypt
      - ./Container-Daten/NginXProxyManager/letsencrypt/logs:/var/log/letsencryp                                                                                                                                                      t
    depends_on:
      - db

  db:
    image: 'yobasystems/alpine-mariadb:latest'
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: '********************'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: '******'
      MYSQL_PASSWORD: '**********************'
    volumes:
      - ./Container-Daten/db:/var/lib/mysql

networks:
  default:
    external:
      name: proxy

I am aware that I still have to fix the calwebdav issues but I thought why not first get an insecure connection. Sadly I don’t manage to do it, does anybody has an idea what to do here?

Cheers
Simon

This is the only message the logs show:
Screenshot_20210816_105734

Managed to make it work!
The solution was pretty simple as always and show that I have no idea how docker networking works…
I was binding the app on port 80 to port 8080 on my host but thats not even necessary.

In my Proxy Manager I can just select the app name (docker ps) which is fpm_web_1 for me and then look at the DOCKER Port to connect to… I was trying to connect to the host port.

Now it’s working and I just need to take care of the caldav problems.