Monitored high http duration / timeouts - how to fix?

Nextcloud version (eg, 18.0.2): docker-compose 18.0.4/latest (mariadb, cron, redis)
Operating system and version (eg, Ubuntu 20.04): Docker CE and Ubuntu
Apache or nginx version (eg, Apache 2.4.25): Apache and fpm
Additional information: I used an ‘external’ nginx as a reverse proxy to all my (docker) services and forward with the following config:

client_max_body_size 16G;
underscores_in_headers on;

location / {
    proxy_headers_hash_max_size 512;
    proxy_headers_hash_bucket_size 64;

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    add_header Front-End-Https on;

    proxy_pass http://127.0.0.1:8080;
}

The issue you are facing:

I am facing high https duration for accessing this service, see attached screenshot. During initial upload of my files I often got a timeout which made me add a monitoring system for http traffic. All other services have response times around 15-35ms, only nextcloud is having >1s which is obviously way too high. I started with the fpm edition, tried to tweak fpm (like mentioned on the nextcloud website) and switched for testing to the apache version.

Steps to replicate it:

  1. Install nextcloud via docker-compose
  2. Use nginx as reverse proxy
  3. Measure http duration

What am I doing wrong? Is this even normal for nextcloud?

Above another service but all other services are looking similar, only nextcloud has this high duration/response time (not shown in screenshot)