Nextcloud behind Nginx proxy

I’m using Nextcloud to share and backup my private files. Nextcloud is software that works like Dropbox, Google Drive, Microsoft OneDrive etc., but in this case I host the Nextcloud service and the files on my private server.

I made a general installation on a Debian VM. I host other sites, incl. this one, on the server too (different VMs however). I also have a Nginx proxy setup, where I use Nginx Proxy Manager to manage the setup and changes.

The combination of Nextcloud and my Nginx Proxy Manager however gave me issues with running Nextcloud on SSL only. I’ve looked around online about this topic and found that I was not the only one with the problem. I also found a solution based on parts of different answers, so I never actually found one answer that solved it for me.

The solution is to change and add some lines to the config/config.php location in the folder of the Nextcloud installation.

I changed the value of the “overwrite.cli.url” to my URL for my Nextcloud on SSL (don’t worry, the URL is not the real one):

Of course you need to replace my URL with your own URL.

I then added the following lines to the end of the array (don’t worry, the URL and IP is not the real one):

You need to replace the 192.168.1.26 with the internal IP address of your Nginx proxy, and you need to change the nc.kef.dev to your own hostname of your Nextcloud installation.

Hope this helps you 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *