<!-- review: finished -->

<a id="http-dav"></a>

# DAV

The module is intended for file management automation via the WebDAV protocol. The module processes HTTP and WebDAV methods PUT, DELETE, MKCOL, COPY, and MOVE.

When [building from the source code](https://en.angie.software//angie/docs/installation/sourcebuild.md#sourcebuild),
this module isn't built by default;
it should be enabled with the
`‑‑with‑http_dav_module`
[build option](https://en.angie.software//angie/docs/installation/sourcebuild.md#configure).

In packages and images from [our repos](https://en.angie.software//angie/docs/installation/index.md#install-packages),
the module is included in the build.

#### NOTE
WebDAV clients that require additional WebDAV methods to operate will not work with this module.

<a id="configuration-example-11"></a>

## Configuration Example

```nginx
location / {
    root                  /data/www;

    client_body_temp_path /data/client_temp;

    dav_methods PUT DELETE MKCOL COPY MOVE;

    create_full_put_path  on;
    dav_access            group:rw  all:r;

    limit_except GET {
        allow 192.168.1.0/32;
        deny  all;
    }
}
```

<a id="directives-12"></a>

## Directives

<a id="index-0"></a>

<a id="create-full-put-path"></a>

### create_full_put_path

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `create_full_put_path` `on` | `off`;   |
|------------------------------------------------------------------------------------------|----------------------------------------|
| Default                                                                                  | `create_full_put_path off;`            |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | http, server, location                 |

The WebDAV specification only allows creating files in already existing directories. This directive allows creating all needed intermediate directories.

<a id="index-1"></a>

<a id="dav-access"></a>

### dav_access

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `dav_access` users:permissions ...;   |
|------------------------------------------------------------------------------------------|---------------------------------------|
| Default                                                                                  | `dav_access user:rw;`                 |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | http, server, location                |

Sets access permissions for newly created files and directories, e.g.:

```nginx
dav_access user:rw group:rw all:r;
```

If any group or all access permissions are specified then user permissions may be omitted:

```nginx
dav_access group:rw all:r;
```

<a id="index-2"></a>

<a id="dav-methods"></a>

### dav_methods

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `dav_methods` `off` | method ...;   |
|------------------------------------------------------------------------------------------|-------------------------------------|
| Default                                                                                  | `dav_methods off;`                  |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | http, server, location              |

Allows the specified HTTP and WebDAV methods. The parameter `off` denies all methods processed by this module. The following methods are supported: PUT, DELETE, MKCOL, COPY, and MOVE.

A file uploaded with the PUT method is first written to a temporary file, and then the file is renamed. Starting from version 0.8.9, temporary files and the persistent store can be put on different file systems. However, be aware that in this case a file is copied across two file systems instead of the cheap renaming operation. It is thus recommended that for any given `location` both saved files and a directory holding temporary files, set by the [client_body_temp_path](https://en.angie.software//angie/docs/configuration/modules/http/index.md#client-body-temp-path) directive, are put on the same file system.

When creating a file with the PUT method, it is possible to specify the modification date by passing it in the `Date` header field.

<a id="index-3"></a>

<a id="min-delete-depth"></a>

### min_delete_depth

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `min_delete_depth` number;   |
|------------------------------------------------------------------------------------------|------------------------------|
| Default                                                                                  | `min_delete_depth 0;`        |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | http, server, location       |

Allows the DELETE method to remove files provided that the number of elements in a request path is not less than the specified number. For example, the directive

```nginx
min_delete_depth 4;
```

allows removing files on requests

```console
/users/00/00/name
/users/00/00/name/pic.jpg
/users/00/00/page.html
```

and denies the removal of

```console
/users/00/00
```
