
Ich habe Probleme mit einer Nextcloud-Instanz, die auf Apache (+php-fpm) als Docker-Container und meinem Nginx-Reverse-Proxy läuft.
Wenn ich die Nextcloud-URL öffne, leitet nginx die Anfrage an Apache weiter und Apache leitet mich zu /index.php/login weiter. Aus irgendeinem Grund gibt nginx jedoch eine 404-Fehlermeldung für /index.php/login zurück.
Dies ist mein Nginx-Protokoll:
172.19.0.0 - - [29/Nov/2021:22:32:01 +0000] "GET / HTTP/1.1" 302 0 "-" "Some UA-String"
172.19.0.0 - - [29/Nov/2021:22:32:01 +0000] "GET /index.php/login HTTP/1.1" 404 548 "-" "Some UA-String"
Meine Nginx-Konfiguration:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name cloud.example.com;
ssl_certificate [...];
ssl_certificate_key [...];
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_intercept_errors on;
proxy_pass http://nextcloud-httpd; #nextcloud-httpd is apaches hostname in the docker network
}
}
Warum übergibt nginx /index.php/login nicht an Apache, aber alle anderen Anfragen? Oh, und wenn ich direkt auf Apache zugreife, funktioniert alles, also muss es der nginx-Proxy sein.
Vielen Dank für Ihre Hilfe ~anghenfil
Antwort1
Ich habe das Problem gefunden! Ich musste die Option „overwriteprotocol“ zu meiner Nextcloud-Konfiguration hinzufügen, um bei https zu bleiben. Grundsätzlich hat Nextcloud mich jedes Mal, wenn ich umgeleitet wurde, auf http umgeleitet. Dies ist ein bekanntes Problem mit Reverse-Proxys und eine typische RTFM-Situation:https://docs.nextcloud.com/server/19/admin_manual/configuration_server/reverse_proxy_configuration.html
Bestes Anghenfil