/.well-known/caldav and carddav with haproxy

Hi,

I know we can fix the caldav/carddav issue with the following lines when using traefik:
traefik.frontend.redirect.permanent: ‘true’
traefik.frontend.redirect.regex: https://(.*)/.well-known/(card|cal)dav
traefik.frontend.redirect.replacement: https://$1/remote.php/dav/

But does anyone have a working configurarion for haproxy?

I’m running Apache and I’d like to avoid edit the .htaccess file.

Regards

Hello @ErAzOr

You can try this:

acl caldav-endpoint path_beg /.well-known/caldav
http-request set-path /remote.php/dav/principals/users/%[query] if caldav-endpoint
use_backend nextcloud_backend if caldav-endpoint

would be nice when u share your experiences :v: :slight_smile:

Hi,
you gave the right hint, but i had to config this:

    acl caldav-endpoint path_beg /.well-known/caldav                                                   
    http-request set-path /remote.php/dav if caldav-endpoint       
    use_backend nextcloud-http if caldav-endpoint                      
                                                                                                       
    acl carddav-endpoint path_beg /.well-known/carddav      
    http-request set-path /remote.php/dav if carddav-endpoint          
    use_backend nextcloud-http if carddav-endpoint

@abyss02 thank you. worked great.

for me, i just needed to add the following to the backend for nextcloud.

   acl caldav-endpoint path_beg /.well-known/caldav                                                   
   http-request set-path /remote.php/dav if caldav-endpoint
                                                                                                      
   acl carddav-endpoint path_beg /.well-known/carddav      
   http-request set-path /remote.php/dav if carddav-endpoint

Hi,

Working on this issue. I have nextcloud accessible with https://myserver/nextcould/
Does-it mean I have to replace the above by
acl caldav-endpoint path_beg /nextcloud/.well-known/caldav
http-request set-path /nextcloud/remote.php/dav if caldav-endpoint

acl carddav-endpoint path_beg /nextcloud/.well-known/carddav
http-request set-path /nextcloud/remote.php/dav if carddav-endpoint