Why am I getting a 403 error when setting up WebDAV on Lighttpd on Xubuntu?

I am trying to setup Lighttpd using Docker on Xubuntu. I have set up a file

htpasswd -bc /etc/lighttpd/webdav.passwd webdavuser webdavpass

And the /etc/lighttpd/conf-enabled/10-webdav.conf looks like this:

server.modules += ( "mod_webdav" )
webdav.activate = "enable"
webdav.is-readonly = "disable"
alias.url += ( "/webdav" => "/var/www/webdav" )
$HTTP["url"] =~ "^/webdav($|/)" {
  auth.backend = "htpasswd"
  auth.backend.htpasswd.userfile = "/etc/lighttpd/webdav.passwd"
  auth.require = ( "/webdav" => (
    "method" => "basic",
    "realm" => "WebDAV",
    "require" => "valid-user"
  ))
}

However, if I try to connect via:

curl -v -u webdavuser:webdavpass http://localhost/webdav/

I get a 403 error.

What am I doing wrong?