Overview
Sometimes you’re facing problems like file synchronizing through classic WebDAV clients (like Zotero) between devices.
| Kit | Disadvantage |
|---|---|
| NextCloud | Written in PHP and extreme slow. |
| ownCloud | Written in Go but support OIDC auth only. |
| nginx | Incomplete WebDAV implementation. |
| caddy | Requiring 3rd-party plugin. |
| httpd | The best and contained in all distro! |
In this case we gonna deploy as following:
nginx (reverse proxy) --> httpd (WebDAV) --> filesystem
httpd
Listen plain HTTP.
Listen 2080
LoadModule dav_module "modules/mod_dav.so"
LoadModule dav_fs_module "modules/mod_dav_fs.so"
<VirtualHost *:2080>
DocumentRoot /var/www/webdav
DavLockDB /tmp/webdav.lock
Alias /webdav /var/www/webdav
<Directory /var/www/webdav>
Dav On
Options Indexes FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "WebDAV Storage"
AuthUserFile /etc/httpd/webdav.htpasswd
Require valid-user
</Directory>
</VirtualHost>
htpasswd -c /etc/httpd/webdav.htpasswd UserName
nginx
Proxy it.
... ... (listener and SSL config)
location /webdav/ {
proxy_pass http://[::1]:2080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 0;
}
Launch
chown -R http:http /var/www/webdav
systemctl enable --now httpd
systemctl reload nginx
Access
Addr: https://(hostname)/webdav
User: (username)
Pass: (password)