Skip to content

Service discover doesn't work behind reverse proxy #577

Description

@funkypenguin

Hey guys,

I'm using NextCloud docker image behind a Traefik SSL-terminating reverse proxy. I found I was unable to use service discovery to configure CalDAV/CardDAV on my iOS device, because the 301 redirect served by https://MYHOST/.well-known/caldav is an http URL (http://MYHOST/remote.php/dav), since the container has no native HTTPS setup.

I've temporarily worked around this by changing the following in .htaccess:

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]

But I imagine this is not an ideal fix, since .htaccess could be automatically updated during upgrades / app installs.

Can we have a config.php option, tied to the occ maintenance:update:htaccess process, which would automatically insert the necessary https elements to ensure service discovery works? Perhaps something like overwrite.redirect.url = https://MYHOST?

Notes:

  1. Issue cal|carddav not setup properly (.htaccess) #528 is related
  2. I've written a more detailed description of the fix here: https://geek-cookbook.funkypenguin.co.nz/recipes/nextcloud/#use-service-discovery

Thanks!
D

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions