Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Caddy ownCloud Gist {
root /usr/local/www/owncloud/
fastcgi / php
rewrite {
regexp /index.php/.*
to /index.php?{query}
log /usr/local/www/owncloud.log
# client support (e.g. os x calendar / contacts)
redir /.well-known/carddav /remote.php/carddav 301
redir /.well-known/caldav /remote.php/caldav 301
# remove trailing / as it causes errors with php-fpm
rewrite {
r ^/remote.php/(webdav|caldav|carddav)(\/?)$
to /remote.php/{1}
rewrite {
r ^/remote.php/(webdav|caldav|carddav)/(.+)(\/?)$
to /remote.php/{1}/{2}
# this is still insanely insecure as all user files are located
# within the docroot and intended .htaccess restrictions are not interpreted
# Deny access copied from the nginx config at
rewrite {
r ^/(?:\.htaccess|data|config|db_structure\.xml|README)
status 403

This comment has been minimized.

Copy link

@shyim shyim commented Mar 26, 2016

When i access with the config the webdav. i get everytime the message: 405 Method Not Allowed. I am currently using OwnCloud 9.
Have you any idea how to fix this?


This comment has been minimized.

Copy link
Owner Author

@dprandzioch dprandzioch commented Aug 6, 2016

@shyim sorry for the late reply. Are you using Caddy 0.8? There was no WebDAV support yet. In Caddy 0.9 it will work :)

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