Delay in Nextcloud Docker with nginx reverse proxy (non-docker)

Hello,
I’m very new to Docker and probably need some help.
I run a homeserver (Ubuntu Server) with different services accessible through the Internet and locally.
Since most of the other services are non-docker I’d like to run the nginx reverse proxy not in a docker container but the normal package-install way.

I also had Nexcloud running (package install) and want to try now running it with docker.
Locally the docker-instance works fine (adressing it with server ip and port).

When trying to address it though my reverse proxy (nginx) there is a terrible delay. And I couldn’t find a solution in the heplforums and internet. The delay is about 30 seconds to 1min.
The nginx-error.log is empty
When I run the nexcloud container in non-daemon mode I see, that it take very long until the request is passed through.
The other services work fine with the reverse proxy.

With running the fpm-package I couldn’t successfully adress the exposed port 9000 so I tried the apache-Version which locally works fine.

Obviously there is something wrong in my nginx setting or I need a different setup.

Which Version of Nextcloud Docker should I use in my setup (Nginx reverse proxy non dockerized)?

How do I configure the reverse proxy?

Here is my recent reverse-proxy setting.

server {
server_name nextcloud.example.com;

  access_log /home/dirk/nginx-access.log;
   error_log /home/dirk/nginx-error.log;

  location / {
  proxy_pass http://localhost:8081;
           proxy_set_header Host $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;
  	add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
  client_max_body_size 0;

}
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/nextcloud.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/nexcloud.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = nextcloud.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

server_name nextcloud.example.com;
listen 80;
return 404; # managed by Certbot
}

here is my docker-compose.yml file

version: ‘3.7’

volumes:
db:

networks:
nextcloud_network:

services:
db:
image: mariadb
restart: always
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=secret4567
- MYSQL_PASSWORD=secret123
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
- nextcloud_network

redis:
image: redis
restart: always
command: redis-server --requirepass secret123
volumes:
- ./redis/data:/data
networks:
- nextcloud_network

app:
image: nextcloud:latest
restart: always
depends_on:
- db
- redis
volumes:
- ./app/nextcloud:/var/www/html
- ./app/apps:/var/www/html/custom_apps
- ./app/config:/var/www/html/config
- /srv/nc/data:/var/www/html/data
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_PASSWORD=secret123
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.example.com
- REDIS_HOST=redis
- REDIS_HOST_PORT=6379
- REDIS_HOST_PASSWORD=secret123
ports:
- 8081:80
networks:
- nextcloud_network

cron:
image: nextcloud:latest
restart: always
volumes:
- ./app/nextcloud:/var/www/html
- ./app/apps:/var/www/html/custom_apps
- ./app/config:/var/www/html/config
- /srv/nc/data:/var/www/html/data
- /etc/localtime:/etc/localtime:ro
entrypoint: /cron.sh
depends_on:
- db
- redis
networks:
- nextcloud_network

Thanks for any ideas,
Dirk