NextCloud Docker RProxy WebDav Probleme

Moin moin,

Ich habe versucht eine NextCloud Instance mit ReverseProxy aufzubauen aber irgendwie kommen folgende Fehler meldungen und Ich kann aus irgendeinem Grund auch nicht mehr auf WebDAV zugreifen aber die Website Funktioniert einwandfrei.

Am Ersten Tag hatte alles einwandfrei funktioniert.

Ich bin am Verzweifeln ^^

Hier ist die nginx.conf:

worker_processes auto;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

set_real_ip_from  10.0.0.0/8;
set_real_ip_from  172.16.0.0/12;
set_real_ip_from  192.168.0.0/16;
real_ip_header    X-Real-IP;

#gzip  on;

upstream php-handler {
    server app: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;" always;
    #
    # WARNING: Only add the preload option once you read about
    # the consequences in https://hstspreload.org/. This option
    # will add the domain to a hardcoded list that is shipped
    # in all major browsers and getting removed from this list
    # could take several months.
    add_header Referrer-Policy "no-referrer" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Download-Options "noopen" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Permitted-Cross-Domain-Policies "none" always;
    add_header X-Robots-Tag "none" always;
    add_header X-XSS-Protection "1; mode=block" always;

    # Remove X-Powered-By, which is an information leak
    fastcgi_hide_header X-Powered-By;

    # Path to the root of your installation
    root /var/www/html;

    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 /public.php?service=host-meta last;
    #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

    # The following rule is only needed for the Social app.
    # Uncomment it if you're planning to use this app.
    #rewrite ^/.well-known/webfinger /public.php?service=webfinger last;

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

    location = /.well-known/caldav {
        return 301 $scheme://$host:$server_port/remote.php/dav;
    }
  
  location = /.well-known/webfinger {
  return 301 $scheme://$host/index.php/.well-known/webfinger;
  }
  
  location = /.well-known/nodeinfo {
  return 301 $scheme://$host/index.php/.well-known/nodeinfo;
  }

    # set max upload size
    client_max_body_size 10G;
    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 expired 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 / {
        rewrite ^ /index.php;
    }

    location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
        deny all;
    }
    location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
        deny all;
    }

    location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
        fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
        set $path_info $fastcgi_path_info;
        try_files $fastcgi_script_name =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $path_info;
        # fastcgi_param HTTPS on;

        # Avoid sending the security headers twice
        fastcgi_param modHeadersAvailable true;

        # Enable pretty urls
        fastcgi_param front_controller_active true;
        fastcgi_pass php-handler;
        fastcgi_intercept_errors on;
        fastcgi_request_buffering off;
    }

    location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
        try_files $uri/ =404;
        index index.php;
    }

    # Adding the cache control header for js, css and map files
    # Make sure it is BELOW the PHP block
    location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
        try_files $uri /index.php$request_uri;
        add_header Cache-Control "public, max-age=15778463";
        # Add headers to serve security related headers (It is intended to
        # have those duplicated to the ones above)
        # Before enabling Strict-Transport-Security headers please read into
        # this topic first.
        #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always;
        #
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        add_header Referrer-Policy "no-referrer" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header X-Download-Options "noopen" always;
        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-Permitted-Cross-Domain-Policies "none" always;
        add_header X-Robots-Tag "none" always;
        add_header X-XSS-Protection "1; mode=block" always;

        # Optional: Don't log access to assets
        access_log off;
    }

    location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ {
        try_files $uri /index.php$request_uri;
        # Optional: Don't log access to other assets
        access_log off;
    }
}

}

Hier ist die docker-compose.yml:

version: ‘3’

services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=STRENGGEHEIM
env_file:
- db.env
networks:
nextcloud-network:
aliases:
- nextcloud-mariadb

redis:
image: redis:alpine
restart: always
networks:
nextcloud-network:
aliases:
- nextcloud-redis

app:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html
environment:
- MYSQL_HOST=db
- REDIS_HOST=redis
env_file:
- db.env
depends_on:
- db
- redis
networks:
nextcloud-network:
aliases:
- nextcloud-app

web:
image: nginx:alpine
restart: always
volumes:
- nextcloud:/var/www/html:ro
- /opt/nextcloud/nginx.conf:/etc/nginx/nginx.conf:ro
environment:
- VIRTUAL_HOST=cloud.geheim.de
- LETSENCRYPT_HOST=cloud.geheim.de
- LETSENCRYPT_EMAIL=admin@geheim.de
depends_on:
- app
networks:
nextcloud-network:
aliases:
- nextcloud
nginx-rproxy_service_network:
aliases:
- nextcloud

cron:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
networks:
nextcloud-network:
aliases:
- nextcloud-cron

volumes:
db:
nextcloud:

networks:
nginx-rproxy_service_network:
external: true
nextcloud-network:
driver: bridge
driver_opts:
com.docker.network.bridge.name: br-nextcloud

Hier ist die Fehlerliste:

Es gibt einige Fehler in Ihrer Systemkonfiguration.

  • Die Konfiguration des Reverse-Proxy-Headers ist falsch. Dies stellt ein Sicherheitsproblem dar und kann es einem Angreifer ermöglichen, seine IP-Adresse so zu fälschen, dass sie für Nextcloud sichtbar ist. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Unsicherer Zugriff auf die Website über HTTP. Es wird dringend empfohlen, Ihren Server so einzurichten, dass HTTPS erforderlich ist. Ohne HTTPS funktionieren einige wichtige Webfunktionen wie “Kopieren in die Zwischenablage” oder “Service Worker” nicht! Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Es konnte weder über Ihre trusted_domains noch über overwrite.cli.url nach JavaScript-Unterstützung gesucht werden. Dies kann auf eine serverseitige DNS-Nichtübereinstimmung oder eine ausgehende Firewall-Regel zurückzuführen sein. Bitte überprüfen Sie manuell, ob Ihr Webserver .mjs-Dateien mit dem JavaScript-MIME-Typ bereitstellt. Um diese Prüfung auszuführen, müssen Sie sicherstellen, dass Ihr Webserver eine Verbindung zu sich selbst herstellen kann. Dafür muss er in der Lage sein, sich mit mindestens einer seiner “trusted_domains” oder der “overwrite.cli.url” zu verbinden und diese aufzulösen.

  • Ihr Webserver ist nicht ordnungsgemäß für die Auflösung von “/ocm-provider/” eingerichtet. Dies hängt höchstwahrscheinlich mit einer Webserver-Konfiguration zusammen, die nicht dahingehend aktualisiert wurde, diesen Ordner direkt zu auszuliefern. Bitte vergleichen Sie Ihre Konfiguration mit den mitgelieferten Rewrite-Regeln in “.htaccess” für Apache oder den in der Nginx-Dokumentation mitgelieferten. Auf Nginx sind das typischerweise die Zeilen, die mit “location ~” beginnen und ein Update benötigen. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Ihr Webserver ist nicht ordnungsgemäß für die Auflösung von .well-known-URLs eingerichtet. Fehler bei: /.well-known/caldav Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • 60 Fehler in den Protokollen seit 26. Juni 2024, 16:29:02

  • Der Server hat keine konfigurierte Startzeit für das Wartungsfenster. Das bedeutet, dass ressourcenintensive tägliche Hintergrundaufgaben auch während Ihrer Hauptnutzungszeit ausgeführt werden. Wir empfehlen, das Wartungsfenster auf eine Zeit mit geringer Nutzung festzulegen, damit Benutzer weniger von der Belastung durch diese umfangreichen Aufgaben beeinträchtigt werden. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Für Ihre Installation ist keine Standard-Telefonregion festgelegt. Dies ist erforderlich, um Telefonnummern in den Profileinstellungen ohne Ländervorwahl zu überprüfen. Um Nummern ohne Ländervorwahl zuzulassen, fügen Sie bitte „default_phone_region“ mit dem entsprechenden ISO 3166-1-Code der Region zu Ihrer Konfigurationsdatei hinzu. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Sie haben Ihre E-Mail-Serverkonfiguration noch nicht festgelegt oder überprüft. Gehen Sie bitte zu den „Grundeinstellungen“, um diese festzulegen. Benutzen Sie anschließend den Button „E-Mail senden“ unterhalb des Formulars, um Ihre Einstellungen zu überprüfen. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

  • Das PHP-Modul “imagick” in dieser Instanz hat keine SVG-Unterstützung. Für eine bessere Kompatibilität empfiehlt es sich, es zu installieren. Weitere Informationen finden Sie in der Dokumentation :arrow_upper_right:.

Spezifikationen:

  • V-Server
  • Debian 12
  • Nextcloud Version 8 (29.0.3)
  • NC Läuft im Docker
  • Mit NGINX-RProxy
  • PHP 8.2.20
  • Webserver läuft über NGINX
  • MySQL Datenbank

Danke für jeden Tipp / Hilfe!!

Grüße,
Luca (Partikel) :slight_smile:

Hier ist noch die Nginx-RProxy docker-compose.yml

version: “3”

services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
container_name: nginx-proxy
restart: always
ports:
- “80:80”
- “443:443”
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /opt/nginx-rproxy/nginx-certs:/etc/nginx/certs
- /opt/nginx-rproxy/nginx-vhost:/etc/nginx/vhost.d
- /opt/nginx-rproxy/nginx-html:/usr/share/nginx/html
- /opt/nginx-rproxy/uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf
networks:
service_network:

nginx-proxy-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
environment:
NGINX_PROXY_CONTAINER: “nginx-proxy”
networks:
service_network:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/nginx-rproxy/nginx-certs:/etc/nginx/certs
- /opt/nginx-rproxy/nginx-vhost:/etc/nginx/vhost.d
- /opt/nginx-rproxy/nginx-html:/usr/share/nginx/html

networks:
service_network:
nginx-rproxy_service_network:
external: true

UPDATE:

  • Die Konfiguration des Reverse-Proxy-Headers ist falsch. Dies stellt ein Sicherheitsproblem dar und kann es einem Angreifer ermöglichen, seine IP-Adresse so zu fälschen, dass sie für Nextcloud sichtbar ist.

Ich habe die Meldung gelöst bekommen.

Jetzt ist mir nur noch wichtig wie Ich das hier Lösen kann mit RProxy:

  • Unsicherer Zugriff auf die Website über HTTP. Es wird dringend empfohlen, Ihren Server so einzurichten, dass HTTPS erforderlich ist. Ohne HTTPS funktionieren einige wichtige Webfunktionen wie “Kopieren in die Zwischenablage” oder “Service Worker” nicht!

Falls jemand eine Idee hat gerne her damit!