Making nextcloud work on a prefixed path (using docker and caddy)

168 Views Asked by At

I'm trying to setup my own instance of nextcloud on my server but I'm running into a problem as I want nextcloud to be available under https://example.com/cloud/.

Next cloud is running in a CoreOS virtual machine called let's say myvm.
So this is the way I setup my CaddyFile:

example.com {
    gzip

    proxy /cloud myvm:8080 {
        transparent
        without /cloud
    }
}

I have other proxies that work fine for other services or VMs that are written similarily.

With this, and publishing port 8080 in my docker-compose file, I manage to connect to the nextcloud instance. But every time I go to example.com/cloud/ it will redirect me to example.com/apps/files/ instead of example.com/cloud/apps/files/.
If I enter this last url manually, I can access to nextcloud, but also the page doesn't load properly because all the contents cannot be loaded because they are not prompted with the prefix cloud/.

Is there a way to explain nextcloud about this prefix through the configuration of docker-compose file? (It's the only configuration I created, it works with just that and no extra work, I use one similar to the one available here (the apache one).)
Or maybe I can improve the CaddyFile config? (By the way, if I don't use the without option, it will just not work at all and return 404 when I go to the url).

0

There are 0 best solutions below