How to use nextcloud with nginx https?

I create a nextcloud server v27 with docker-compose.

version: '3.9'
services:
  office-nextcloud:
    image: nextcloud:27.1.7
    container_name: &app_name office-nextcloud
    hostname: *app_name
    extra_hosts:
      - "nextcloud.xxxx.com: ip"
    ports:
      - 8080:80
    volumes:
      - ./vol/nextcloud/html:/var/www/html
    environment:
      - MYSQL_HOST=office-mysql
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=root
      - MYSQL_PASSWORD=
    depends_on:
      - office-mysql

  office-mysql:
    image: mysql:5.7
    container_name: &app_name office-mysql
    hostname: *app_name

And manually install Nextcloud Office and Collabora Online - Built-in CODE Server app.
They are all worked well.

And I create a nginx proxy for ssl. Same time disable nextcloud http port.

  office-nginx:
    image: nginx:1.19.10_230703
    container_name: &app_name office-nginx
    hostname: *app_name
    extra_hosts:
      - "nextcloud.xxxx.com: ip"
    ports:
      - 8080:8080
    volumes:
      - ./vol/nginx/ssl:/ssl
      - ./vol/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
      - ./vol/nginx/conf/nginx-access.log:/etc/nginx/nginx-access.log
      - ./vol/nginx/conf/nginx-error.log:/etc/nginx/nginx-error.log
    depends_on:
      - office-nextcloud

I also modify the config.php with ‘overwriteprotocol’ => ‘https’.
The nextcloud is worked well. But I can’t open docs any more. The setting always focus on “https://nextcloud.xxxx.com:8080/app/coll*****/proxy?***” ( I can’t remember all about it. But almost it is.)

Here is the nginx config:

worker_processes  1;
events {
    worker_connections  1024;
}
error_log /etc/nginx/nginx-error.log error;
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    access_log /etc/nginx/nginx-access.log combined;

    server {
        listen 8080 ssl http2;
        listen [::]:8080 ssl http2;
        server_name nextcloud.xxxx.com;
        # ssl on;
        ssl_certificate         /ssl/1/cert.pem;
        ssl_certificate_key     /ssl/1/key.pem;
        ssl_password_file       /ssl/1/cert.pwd;
        client_max_body_size    1G;
        location / {
            proxy_pass       http://office-nextcloud;
            proxy_set_header Host $http_host;
            proxy_redirect  off;
        }
    }
}

Other file can open but not docx odt file.