Raíz de Nginx dentro de un contenedor de docker

Estoy intentando ejecutar la nextcloud acoplable de siguientecloud en un subdirectory que apunta /var/www/nextcloud en una nginx acoplable de nginx .

Pero no importa lo que haga, nginx continúa intentando servir el /var/www/nextcloud/nextcloud cuando tengo acceso a él.

Este es el ngix.conf (observe la línea root /var/www; )

 user www-data; http { upstream backend { server nextcloud:9000; } upstream php-handler { server nextcloud:9000; } server { listen 80; # Add headers to serve security related headers # Before enabling Strict-Transport-Security headers please read into this # topic first. #add_header Strict-Transport-Security "max-age=15768000; # includeSubDomains; preload;"; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; # Path to the root of your installation root /var/www; location = /robots.txt { allow all; log_not_found off; access_log off; } # The following 2 rules are only needed for the user_webfinger app. # Uncomment it if you're planning to use this app. # rewrite ^/.well-known/host-meta /nextcloud/public.php?service=host-meta # last; #rewrite ^/.well-known/host-meta.json # /nextcloud/public.php?service=host-meta-json last; location = /.well-known/carddav { return 301 $scheme://$host/nextcloud/remote.php/dav; } location = /.well-known/caldav { return 301 $scheme://$host/nextcloud/remote.php/dav; } location /.well-known/acme-challenge { } location ^~ /nextcloud { # set max upload size client_max_body_size 512M; fastcgi_buffers 64 4K; # Enable gzip but do not remove ETag headers gzip on; gzip_vary on; gzip_comp_level 4; gzip_min_length 256; gzip_proxied expinetworking no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; # Uncomment if your server is build with the ngx_pagespeed module # This module is currently not supported. #pagespeed off; location /nextcloud { rewrite ^ /nextcloud/index.php$uri; } 

Y luego tengo lo siguiente en mi nginx docker-compose.yml (observe la línea - /mnt/server/nextcloud:/var/www/nextcloud en los volúmenes:

  web: image: nginx container_name: nginx-webserver volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - /mnt/server/nextcloud:/var/www/nextcloud external_links: - nextcloud environment: - VIRTUAL_HOST=${DOMAIN} - VIRTUAL_NETWORK=nginx-proxy - VIRTUAL_PORT=80 - LETSENCRYPT_HOST=${DOMAIN} - LETSENCRYPT_EMAIL=myemail networks: - proxy-tier restart: always networks: proxy-tier: external: name: nginx-proxy 

Y finalmente mi docker-compose.yml para nextcloud (observe el - /mnt/server/nextcloud/:/var/www/html/ line para los volúmenes):

 version: '2' services: nextcloud: image: nextcloud:fpm container_name: nextcloud links: - db volumes: - /mnt/server/nextcloud/:/var/www/html/ - /mnt/server/nextcloud/apps:/var/www/html/apps/ - /mnt/server/nextcloud/config:/var/www/html/config/ - /mnt/server/nextcloud/data:/var/www/html/data/ networks: - proxy-tier restart: always networks: proxy-tier: external: name: nginx-proxy