Nextcloud & Nginx Proxy Manager (or changing URL path)

I have DietPi running within a Proxmox VM. I want to use this DietPi installation solely for Nextcloud. Since I’m using Nginx Proxy Manager to access my services (Immich, Home Assistant, etc.) from outside my home, I want to use this for the Nextcloud instance as well.

My problem is that usually, I will simply point incoming requests for any of my subdomains, e.g., immich.domain.tld to Nginx Proxy Manager and then forward it to the relevant server. e.g., 192.168.0.100:2283. But for Nextcloud, I cannot simply use an IP address and a port for the forward address, but I need to include the /nextcloud. I’m not sure how to do this with Nginx Proxy Manager.

So I have two options: Either move Nextcloud to the root path, so I don’t need /nextcloud anymore. Or somehow configure Nginx Proxy Manager to use the sub path /nextcloud.

Is someone able to help me with either of those solutions?

Simply use the custom location option on a proxy host. That’s it.

1 Like

I thought as much, but I’m not sure how I have to configure the custom location. Could you please provide an example or link to one?

Its quite simple. Add the location folder /nextcloud and as usual target IP+port

Any suggestions as to what I need to change here? I’ve tried various combinations, but either I end up at the default apache2 index.php file, or I get an error.


On the 2nd scree, don’t add the sub forward hostname

Seems like the custom locations are not working as you would expect. I found other people having similar issues on the Nginx Proxy Manager GitHub. Luckily, someone provided a solution that works. So if anyone stumbles upon this issue as well, here is what I did to make it work:

location = / {
    return 301 /<subpath>/;
}

The custom location can be deleted.

Taken from here: