Owncloud with Caddy 0.9.2

Hi there!

I have installed Caddy 0.9.2 and Owncloud 9.1.1. But I get errors with Webdav client. I am running Ubuntu 16.04.1 LTS.

Here is my Caddyfile

cloud.server.ru:80 {
redir https://cloud.server.ru{uri}
     header / {
      Content-Security-Policy "default-src https:"
      X-XSS-Protection "1; mode=block"
      X-Frame-Options "SAMEORIGIN"
      X-Content-Type-Options "nosniff"
      Server "My Cloud Server"

cloud.server.ru:443 {
root /var/www/owncloud
fastcgi / unix:/run/php/php7.0-fpm.sock php {
    env PATH /bin
 rewrite {
    r ^/index.php/.*$
    to /index.php?{query}
# 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}
# .htacces / data / config / ... shouldn't be accessible from outside
status 403  {
     header / {
      Strict-Transport-Security "max-age=31536000"
      Server "My Cloud Server"
    header /* {
            Server "My Cloud Server"

Can you help me with fixing Caddyfile?

What errors are you getting? (What does the Webdav client say, what does Caddy error log say)

Sometimes I get 502 error on main page.
Actually I get no errors in log

Sep 22 00:04:18 cloud.server.ru systemd[1]: Started Caddy HTTP/2 web server.
Sep 22 00:04:18 cloud.server.ru caddy[1649]: Activating privacy features... done.
Sep 22 00:04:18 cloud.server.ru caddy[1649]: http://cloud.server.ru
Sep 22 00:04:18 cloud.server.ru caddy[1649]: https://cloud.server.ru
Sep 22 00:10:00 cloud.server.ru caddy[1649]: 2016/09/22 00:10:00 [INFO] - No such site at :443 (Remote:, Referer: )
Sep 22 00:19:34 cloud.server.ru caddy[1649]: 2016/09/22 00:19:34 [INFO]  - No such site at :80 (Remote:, Referer: )
Sep 22 00:36:21 cloud.server.ru caddy[1649]: 2016/09/22 00:36:21 [INFO] - No such site at :80 (Remote:, Referer: )

cloud.server.ru, is that something you replaced into the logs to hide your real domain?
Never seen the No such site at :443 error for a domain…

Yes. You can see real domain name in the email.

@matt could you elaborate the meaning of the errors?

The “no such site at :443” errors just mean that a request was received for a hostname that Caddy isn’t configured to serve; :443 is the address of the listener that accepted the request but didn’t know what to do with it.

Any ideas how to fix Caddyfile to work with Owncloud on Caddy 0.9.2?

The PHP errors might be related to issues 1123 or 1128. We’re working on a hotfix.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.