Nginx Configuration for NextCloud

Hello. I am a starter with Nextcloud and Docker. I am trying to set up my Nextcloud using nginx in Docker. My nginx has already had another app with Meteor and certificates are already set. I am trying to define a location under https server to redirect my traffic to nextcloud. I have checked and it seems that my nginx sees the Nextcloud container with the port 80. When I redirect the traffic to /nextcloud, the nextcloud page does not come up properly (something like CSS file has not been loaded) and the set up for nextcloud and MariaDB does not work. I am using the following proxy_pass for it (added in the HTTPS server and over the other Meteor app). Has someone any idea what should I do to fix it? Thanks.

# For nextcloud
    location /nextcloud {

            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;
            #proxy_redirect off;
            add_header Front-End-Https on;

            #rewrite ^/nextcloud(/.*)$ /$1 break;
            proxy_pass http://nextcloud_app:80/;


I tried setting up nginx on ubuntu with nextcloud as a fresh installation. Somehow it’s a lot harder than using apache.
In your case it will be even more difficult.
There is an example nginx configuration in the documentation. But I’m afraid that will be of little use to you.
Perhaps it’s possible to contact nextcloud support directly?
I hope you will figure it out :slight_smile:

Here you can find an example how to run multiple web server in different container.