Different rewritebase depending on trusted domain access?

Hello all,

I’m running Nextcloud docker on a VM (called “server”) on my server, and I have another VM (called “frontend”) running caddy that does all the reverse proxying.

I access my nextcloud instance through https://mydomain.net/nc/, and I have the Rewritebase.url set to /nc/.

Everything works fine.

But I would also like to access it through http://server:8888 directly (it’s in my trusted domains), but the Rewritebase.url prevents this from working.

Do you know if it is possible to have a trusted domain-dependent Rewritebase?

Thanks a lot!