Friends,
I’m trying to configure Nextcloud on my home ARM32 server (Nextcloud releases official ARM builds on their Docker Hub) with Raspbian (Ubuntu) and Docker. I run all my web services under Docker behind a dockerized NGNIX reverse proxy. Usually it’s easy to set up, but with Nextcloud I’m simply out of ideas at this point.
The problem:
I can connect to Nextcloud if I’m making Its Docker container to share an external port outside (like 8080); then I can use my machine’s local IP address and reach the configuration panel.
However I’m configuring Nextcloud behind NGINX reverse proxy, though, I can’t connect to the service thru that chain.
I’d like to make it work, so I can use one of my subdomains in order to redirect it do my Nextcloud container.
Let’s start with how my NGINX configuration looks like:
server { listen 80; server_name subdomain.domain.org; location / { proxy_pass http://172.18.0.4:80/; include /etc/nginx/proxy_params; } }
proxy_params consist of:
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
I think it’s a bare minimum configuration in order to achieve a HTTP forward on NGNIX to a given container.
To ensure myself that I’m not having any networking issues I use http://172.18.0.4:80/
as a Nextcloud target container internal IP address instead of a host name.
I run couple other services in a similar way, and I don’t have any routing problems even with NIGNX routines much more complicated than the above…
Now, Nextcloud’s documentation says that in order for Nextcloud to work with an external proxy the config.php file must be updated with the proxy IP address. I used in my configuration:
“trusted_proxies” => [‘172.18.0.3’],
in the first row of a default configuration file.
The 172.18.0.3
is my NGINX’s IP address within Docker.
I was also trying to provide more data to that file, similar to the following post: Nginx reverse proxy, what to write in nextcloud's config.php? - #35 by shperrung including: my subdomain, localhost, Docker container host names, containers IPs - in many configurations. Nothing helps.
Because I don’t know much about Nextcloud, I don’t know if I’m making some simple configuration error there, or maybe I’ve configured something wrong with NGINX (although my configuration passes the ngingx -s reload
test without errors).
I’d like to ask those of you who run your Nextclouds in a similar environment to either post your configs for both NGINX and Nextcloud’s config.php and/or to point me in a direction that’s going to help me to solve the current misconfiguration.
All help is greatly appreciated!