diff --git a/README.md b/README.md index 9597e86..49494bc 100644 --- a/README.md +++ b/README.md @@ -32,15 +32,55 @@ The native nginx dav_module has been integrated with a few changes for client co The community [nginx_dav_ext_module](https://github.com/MkfsSion/nginx-dav-ext-module) is integrated as well for proper full WebDAV support. -# Using +# Usage There are a few reasonable ways of setting it up. 1. Standalone mode with authentication -TODO webdav apis with an htpasswd file through nginx basic authentication +location / { + auth_basic "My closed site, go away!"; + auth_basic_user_file /usr/share/nginx/htpasswd; -2. Managed mode with subrequest full cloud functionality + client_body_temp_path /var/nginx/webdav_client_temp; + webdav_methods PUT DELETE MKCOL COPY MOVE PROPFIND OPTIONS LOCK UNLOCK; + create_full_put_path on; + webdav_access all:rw; + webdav_lock zone=foo; -TODO webdav apis with database managed through django + root /var/nginx/webdav; + index index.html index.htm; +} + +2. Managed mode with subrequest full cloud functionality with [starfields-cloud](https://git.vickys-corner.xyz/StarFields/starfields-cloud) + +location / { + auth_request /cloud/auth/; + + client_body_temp_path /var/nginx/webdav_client_temp; + dav_ext_methods PUT DELETE MKCOL COPY MOVE PROPFIND OPTIONS LOCK UNLOCK; + create_full_put_path on; + dav_access all:rw; + dav_ext_lock zone=foo; + + root /var/nginx/webdav; + index index.html index.htm; +} + +location = /cloud/auth/ { + internal; + + proxy_pass_request_headers on; + proxy_pass_request_body on; + proxy_set_header X-Original-Method $request_method; + proxy_set_header X-Original-URI $request_uri; + proxy_pass http://localhost:8000/api/v1/cloud/auth/; + + # OR + # uwsgi_pass_request_headers on; + # uwsgi_pass_request_body on; + # uwsgi_param X-Original-Method $request_uri; + # uwsgi_param X-Original-URI $request_uri; + # uwsgi_pass unix:/path/to/my/django.sock; +} # Directives | Directive | Specification | Context | Description |