1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| server { listen 80; server_name webdav.example.com; location / { if ($request_method = POST) { return 307 https://$host$request_uri; } return 301 https://$host$request_uri; } }
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name webdav.example.com; root /var/www/webdav/; index index.html index.htm; access_log /var/log/nginx/webdav/access.log combined gzip; error_log /var/log/nginx/webdav/error.log warn; ssl_certificate /etc/nginx/ssl/webdav.example.com.crt; ssl_certificate_key /etc/nginx/ssl/webdav.example.com.key; ssl_dhparam /etc/nginx/ssl/dhparams.pem; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; add_header Strict-Transport-Security "max-age=31536000"; add_header X-Content-Type-Options nosniff;
location / { auth_basic "Restricted site."; auth_basic_user_file /etc/nginx/auth/webdav-users.passwd; client_body_temp_path /var/www/webdav/temp; dav_methods PUT DELETE MKCOL COPY MOVE; dav_ext_methods PROPFIND OPTIONS; create_full_put_path on; dav_access user:rw group:rw all:rw; autoindex on; } }
|