Skip to content

Instantly share code, notes, and snippets.

@pawl
Last active August 1, 2023 05:41
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save pawl/1efd102ee7953c1af0aa68054aa53999 to your computer and use it in GitHub Desktop.
Save pawl/1efd102ee7953c1af0aa68054aa53999 to your computer and use it in GitHub Desktop.
Installing nginx webdav server on ubuntu 20.04
server {
listen 80;
listen [::]:80;
root /var/dav/webdav_root;
# dav allowed method
dav_methods PUT DELETE MKCOL COPY MOVE;
# Allow current scope perform specified DAV method
dav_ext_methods PROPFIND OPTIONS;
# In this folder, newly created folder or file is to have specified permission. If n>
dav_access all:rw;
# Temporary folder
client_body_temp_path /var/dav/tmp;
# MAX size of uploaded file, 0 mean unlimited
client_max_body_size 0;
# Allow autocreate folder here if necessary
create_full_put_path on;
}
# Warning: don't use this for sensitive data, there's no SSL or authentication
# for ubuntu 20.04
# only allow access from another server with a dedicated ip
ufw allow from x.x.x.x
ufw enable
apt-get update
apt-get upgrade
apt-get install nginx-full
mkdir -p /var/dav/webdav_root
sudo chown -R www-data:www-data /var/dav/
rm /etc/nginx/sites-available/default
rm /etc/nginx/sites-enabled/default
# copy over webdav.conf
nano /etc/nginx/conf.d/webdav.conf
@yaroslav-ilin
Copy link

Note: the WebDAV server configured this way would only mount as read-only in macOS Finder.

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