From d1b8c94b7cb2e598643c742c222ac50d5917b562 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 6 Dec 2017 15:34:06 +0100 Subject: FTP over WebDAV --- custom/ymir-nginx.nix | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'custom') diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix index a1de81c3..dcee84fa 100644 --- a/custom/ymir-nginx.nix +++ b/custom/ymir-nginx.nix @@ -175,8 +175,6 @@ in { listen [::]:443 ssl; server_name ~^(.*\.)?bragi\.(yggdrasil\.li|141\.li)$; - include ${acme}; - location / { auth_basic "Reverse proxy to bragi"; auth_basic_user_file /srv/www/bragi/htpasswd; @@ -184,6 +182,39 @@ in { proxy_pass http://bragi.asgard.yggdrasil/; } } + + server { + listen *:80; + listen [::]:80; + server_name ~^ftp\.(yggdrasil\.li|141\.li|praseodym\.org)$; + + include ${acme}; + + location / { + return 301 https://$host$request_uri; + } + } + + server { + listen *:443 ssl; + listen [::]:443 ssl; + + server_name ~^ftp\.(yggdrasil\.li|141\.li|praseodym\.org)$; + + client_body_temp_path /tmp/webdav; + + location / { + root /srv/ftp/$remote_user; + autoindex on; + + auth_basic "FTP over WebDAV"; + auth_basic_user_file /srv/ftp.htpasswd; + + dav_methods PUT DELETE MKCOL COPY MOVE; + create_full_put_path on; + dav_access user:rw group:r all:r; + } + } ''; }; } -- cgit v1.2.3