Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

webdav setup with nginx

install nginx

With webdav module

apt install libxslt-dev --no-install-recommends
make -f nginxbuild.mk install DAV=true

add /etc/nginx/webdav.passwd

read -p "Enter username: " username && read -sp "Enter password: " password && echo "$username:$(openssl passwd -apr1 $password)" | sudo tee -a /etc/nginx/webdav.passwd && echo -e "\nCredentials added successfully."
usermod -aG booger nginx
usermod -aG nginx booger
chmod g+rwx /srv/webdav/

nginx server conf

server {
	#listen 80 ;
	listen 443 ssl ;
	http2 on;
	server_name webdav.aeza.boogerman.xyz ;

	ssl_certificate /home/booger/.acme.sh/aeza.boogerman.xyz_ecc/fullchain.cer;
	ssl_certificate_key /home/booger/.acme.sh/aeza.boogerman.xyz_ecc/aeza.boogerman.xyz.key;

	ssl_session_cache shared:SSL:1m;
	ssl_session_timeout 5m;

	ssl_ciphers HIGH:!aNULL:!MD5;
	ssl_prefer_server_ciphers on;

	root /srv/webdav ;

	location ~ /\. {
		deny all;
		access_log off;
		log_not_found off;
	}

	location / {
		dav_methods PUT DELETE MKCOL COPY MOVE;
		dav_ext_methods PROPFIND OPTIONS;
		dav_access user:rw group:rw;

		client_max_body_size 0;
		create_full_put_path on;
		client_body_temp_path /tmp/;

		# Basic authentication setup
		auth_basic "Restricted Access";
		auth_basic_user_file /etc/nginx/webdav.passwd;

		# Deny all access unless authenticated
		satisfy all;
		allow all; # This allows all authenticated users
		deny all; # This denies all other users

		# Deny all access except zelenika
		#allow 62.4.35.1 ;
		#deny all ;
	}
}