Can't run nextcloud with docker-compose

This is weird. First of all, this is my docker-compose file:

version: '3'

services:

  proxy:
    image: jwilder/nginx-proxy:alpine
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"
    container_name: nextcloud-proxy
    networks:
      - nextcloud_network
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./proxy/conf.d:/etc/nginx/conf.d:rw
      - ./proxy/vhost.d:/etc/nginx/vhost.d:rw
      - ./proxy/html:/usr/share/nginx/html:rw
      - ./proxy/certs:/etc/nginx/certs:ro
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: unless-stopped

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nextcloud-letsencrypt
    depends_on:
      - proxy
    networks:
      - nextcloud_network
    volumes:
      - ./proxy/certs:/etc/nginx/certs:rw
      - ./proxy/vhost.d:/etc/nginx/vhost.d:rw
      - ./proxy/html:/usr/share/nginx/html:rw
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

  db:
    image: mariadb
    container_name: nextcloud-mariadb
    networks:
      - nextcloud_network
    volumes:
      - /srv/docker-persist/MariaDB/nextcloud-sql:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=database
      - MYSQL_USER=use
    restart: unless-stopped

  app:
    image: nextcloud:latest
    container_name: nextcloud-app
    networks:
      - nextcloud_network
    depends_on:
      - letsencrypt
      - proxy
      - db
    volumes:
      - nextcloud:/var/www/html
      - ./app/config:/var/www/html/config
      - ./app/custom_apps:/var/www/html/custom_apps
      - /mnt/NC:/var/www/html/data
      - ./app/themes:/var/www/html/themes
      - /etc/localtime:/etc/localtime:ro
    environment:
      - VIRTUAL_HOST=sub.domain.com
      - LETSENCRYPT_HOST=sub.domain.com
      - LETSENCRYPT_EMAIL=mail@domain.com
    restart: unless-stopped

volumes:
  nextcloud:
  db:

networks:
  nextcloud_network:

I can deploy this with docker-compose up -d. But if i try to access nginx/nextcloud with my ip address i only get

503 Service Temporarily Unavailable

nginx/1.19.3

I know, that i already used this docker-compose 1 or 2 years ago and everything worked. Whats wrong?

nginx.1    | 2022/03/23 11:47:34 [emerg] 31#31: no servers are inside upstream in /etc/nginx/conf.d/default.conf:68
nginx.1    | nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:68
forego     | starting nginx.1 on port 5200
forego     | sending SIGTERM to nginx.1
forego     | sending SIGTERM to dockergen.1
forego     | starting dockergen.1 on port 5000
forego     | starting nginx.1 on port 5100
nginx.1    | 2022/03/23 11:47:36 [emerg] 29#29: no servers are inside upstream in /etc/nginx/conf.d/default.conf:68
forego     | starting nginx.1 on port 5200
forego     | sending SIGTERM to nginx.1
forego     | sending SIGTERM to dockergen.1
forego     | starting dockergen.1 on port 5000
forego     | starting nginx.1 on port 5100
dockergen.1 | 2022/03/23 11:47:39 Generated '/etc/nginx/conf.d/default.conf' from 16 containers
dockergen.1 | 2022/03/23 11:47:39 Running 'nginx -s reload'
dockergen.1 | 2022/03/23 11:47:39 Watching docker events
dockergen.1 | 2022/03/23 11:47:39 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2022/03/23 11:47:40 Received event start for container 76785057659d
dockergen.1 | 2022/03/23 11:47:41 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
dockergen.1 | 2022/03/23 11:47:41 Received event start for container 61b0ae21e9ba
dockergen.1 | 2022/03/23 11:47:41 Generated '/etc/nginx/conf.d/default.conf' from 18 containers
dockergen.1 | 2022/03/23 11:47:41 Running 'nginx -s reload'
dockergen.1 | 2022/03/23 11:47:41 Error running notify command: nginx -s reload, exit status 1
nginx.1    | nginx: [emerg] no servers are inside upstream in /etc/nginx/conf.d/default.conf:68

and indeed its empty

# sub.domain.com
upstream sub.domain.com {
}

what know?

please use search function - this post describe exactly the same issue and point to some solution.

there are many working nginx configurations posted as well.

tbh i can’t see how this is solving my problem - also all those links inside this thread and in github. But indeed, this example docker-compose is working like a charm