Nextcloud virtual host catches all requests!

Hi,

I configured my nethserver instance to create a virtualhost for nextcloud using those three really friendly commands :

config setprop nextcloud VirtualHost drive.mydomain.tld
config setprop nextcloud TrustedDomains drive.mydomain.tld
signal-event nethserver-nextcloud-update

It works perfectly, bu I remarked that each and every request to that virtualhost was redirected to drive.mydomain.tld/drive.mydomain.tld/index.php/login

Now my problem is that I’d like to add the /.well-known/caldav and /.well-known/carddav redirections (301 to /nextcloud/remote.php/dav) to the root of that VirtualHost (to enable auto-configuration of clients).

How do I do this ? (in a way that would survive configuration changes of course)

Thanks

Matthieu

after some educated trial-error I finally found a way to make it work : just create a .htaccess file into the document root (which is /var/www/html/) and add those line :

Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav

I first tried to add those lines to the /etc/httpd/conf.d/zz_nextcloud.conf file but it didn’t work.

I hope my solution is good. Please comment :slight_smile:

3 Likes

I think this is the easiest and best solution.

1 Like