Skip to content

cal|carddav not setup properly (.htaccess) #528

Closed

Description

@jkaberg

Running nextcloud:14.0.3 @ https://cloud.domain.tld/ (with Traefik as a reverse proxy in front)

From Settings->Administration->Overview

 There are some warnings regarding your setup.

    Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation.
    Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation.

The documentation can be found here.

Shouldn't this be working by default? The .htaccess file already contains these settings

Activity

  1. SnowMB commented on Oct 31, 2018

    @SnowMB
    Contributor

    I experienced the same warning, but everything seems to work as expected. (I also use traefik as reverse proxy).

    I found an issue in the server repo that seems related: nextcloud/server#11850

    Might be something with the schema, because if I curl .well-known/carddav it gives me http and not https.

    ➜  ~ curl -i https://DOMAIN/.well-known/caldav
    HTTP/2 301 
    content-type: text/html; charset=iso-8859-1
    date: Wed, 31 Oct 2018 10:12:25 GMT
    location: http://DOMAIN/remote.php/dav/
    referrer-policy: strict-origin
    server: Apache/2.4.25 (Debian)
    strict-transport-security: max-age=31536000; includeSubdomains; preload
    content-length: 325
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>301 Moved Permanently</title>
    </head><body>
    <h1>Moved Permanently</h1>
    <p>The document has moved <a href="http://DOMAIN/remote.php/dav/">here</a>.</p>
    <hr>
    <address>Apache/2.4.25 (Debian) Server at DOMAIN Port 80</address>
    </body></html>
    

    Will investigate further...

  2. SnowMB commented on Oct 31, 2018

    @SnowMB
    Contributor

    So this eliminates the warning:

    Changing the .htaccess file to

    ...
      RewriteRule ^\.well-known/carddav https://DOMAIN/remote.php/dav/ [R=301,L]
      RewriteRule ^\.well-known/caldav https://DOMAIN/remote.php/dav/ [R=301,L]
    
    ...
    

    But this is no solution for this image, since we are using the stock .htaccess file. 🤔

  3. funkypenguin commented on Dec 12, 2018

    @funkypenguin

    Another Traefik user here..

    I similarly changed:

      RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
      RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
    

    To:

      RewriteRule ^\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
      RewriteRule ^\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
    

    And now service discovery works on my iOS devices :)

    D

  4. J0WI commented on Dec 12, 2018

    @J0WI
    Contributor

    This could be fixed with #527

  5. marceljd commented on Feb 9, 2019

    @marceljd
    Contributor

    Real fix in #644

  6. SnowMB commented on May 28, 2019

    @SnowMB
    Contributor

    To fix this issue traefik should be configured for the service discovery. In the nexcloud 16 documentation a fix is given.

    add the following labels to the nextcloud container:

    traefik.frontend.redirect.permanent: 'true'
    traefik.frontend.redirect.regex: https://(.*)/.well-known/(card|cal)dav
    traefik.frontend.redirect.replacement: https://$$1/remote.php/dav/
    
    
    
  7. jkaberg commented on Jun 4, 2019

    @jkaberg
    Author

    Thanks @SnowMB for point that out, this resolved it for me.

    Feel free to close

  8. georg90 commented on Dec 28, 2021

    @georg90

    Anyone trying this with traefik 2.4..

    For me this config works on NC 23.0:

    nextcloud-redirect:
          redirectRegex:
            permanent: true
            regex: "https://(.*)/.well-known/(card|cal)dav"
            replacement: "https://${1}/remote.php/dav/"
    
  9. Nexxus-LMT commented on Jun 22, 2022

    @Nexxus-LMT

    Anyone trying this with traefik 2.4..

    For me this config works on NC 23.0:

    nextcloud-redirect:
          redirectRegex:
            permanent: true
            regex: "https://(.*)/.well-known/(card|cal)dav"
            replacement: "https://${1}/remote.php/dav/"
    

    Works for me on rk3s install using traefik. Full Middleware:

    kind: Middleware
    metadata:
      name: your-name
      namespace: your-namespace
    spec:
      redirectRegex:
        permanent: true
        regex: "https://(.*)/.well-known/(card|cal)dav"
        replacement: "https://${1}/remote.php/dav/"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions