How to provide Webdav encrypted connection?

1. Caddy version (caddy version):

v2.4.6 h1:HGkGICFGvyrodcqOOclHKfvJC0qTU7vny/7FhYp9hNw=

2. How I run Caddy:

a. System environment:

Docker 20.10.12, build e91ed57 under Ubuntu 20.04

b. Command:

docker-compose up -d caddy

c. Service/unit/compose file:

Dockerfile ==
    caddy:
        container_name: caddy
        image: local/caddytest
        build:
            context: ./images/caddy
            dockerfile: ./Dockerfile
        env_file: docker.env
        ports:
            - 80:80
            - 443:443
            - 5001:5001
        restart: "no"
        volumes:
            - /home/docker/caddy/data:/data/caddy/
            - /home/docker/caddy/etc:/etc/caddy
            - '/etc/resolv.conf:/etc/resolv.conf:ro'
            - /media/webdav:/media/webdav

d. My complete Caddyfile or JSON config:

{
  # Global options block. Entirely optional, https is on by default
  # Optional email key for lets encrypt
  email myemail
  # Optional staging lets encrypt for testing. Comment out for production.
  #acme_ca https://acme-staging-v02.api.letsencrypt.org/directory


  order webdav before file_server
}
:5001 {

  root * /media/webdav

  @notget {
    not method GET
  }

  route @notget {
    basicauth {
      jeff myhashcode
    }
    webdav
  }

}


3. The problem Iā€™m having:

I can access my files, but I would like to be able to offer Webdav on a secure connection.

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

To use HTTPS, you need a domain.

Instead of :5001 in your config, place your domain name there. Make sure your DNS is configured to point to your Caddy server, and that ports 80 and 443 are forwarded/open on your router/firewall to let the connections through.

1 Like

My hero! Thanks so much.

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.