I'm having issues with an nextcloud instance running on apache (+php-fpm) as a docker container and my nginx reverse proxy.
When I open the Nextcloud URL nginx proxies the request to apache and apache redirect me to /index.php/login. However, for some reason, nginx returns an 404 for /index.php/login.
This is my nginx log:
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"
My nginx config:
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
}
}
Why does nginx doesn't pass /index.php/login to apache but passes all other requests? Oh and if I'm accessing apache directly everything works, so it have to be the nginx proxy.
Appreciate your help ~anghenfil