<!-- review: finished -->

<a id="external-dav-ext"></a>

# DAV-Ext

Este módulo extiende el soporte WebDAV con los métodos PROPFIND, OPTIONS, LOCK y UNLOCK.

El módulo estándar [DAV](https://es.angie.software//angie/docs/configuration/modules/http/http_dav.md#http-dav) proporciona una implementación parcial de
WebDAV y solo soporta los métodos GET, HEAD, PUT, DELETE, MKCOL, COPY y MOVE.
Para lograr un soporte WebDAV completo, necesitas habilitar el módulo estándar
`http_dav_module`, así como este módulo para los métodos faltantes.

<a id="installation-7"></a>

## Instalación

Para [instalar](https://es.angie.software//angie/docs/installation/index.md#install-packages) el módulo, usa uno de los
siguientes paquetes:

- Angie: `angie-module-dav-ext`
- Angie PRO: `angie-pro-module-dav-ext`

<a id="loading-the-module-6"></a>

## Carga del módulo

Carga el módulo en el contexto `main{}`:

```nginx
load_module modules/ngx_http_dav_ext_module.so;
```

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

## Ejemplo de configuración

```nginx
dav_ext_lock_zone zone=lock_zone:10m;
server {
    listen 80 default_server;

    location / {
        root /usr/share/angie/html;

        dav_methods PUT DELETE MKCOL COPY MOVE;
        dav_ext_methods PROPFIND OPTIONS LOCK UNLOCK;
        dav_ext_lock zone=lock_zone;
    }
}
```

<a id="request-execution-examples"></a>

## Ejemplos de ejecución de solicitudes

Subir un archivo al servidor:

```console
$ curl -i -X PUT -d @testf1.txt http://127.0.0.1/testf1.txt
HTTP/1.1 201 Created
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Content-Length: 0
Location: http://127.0.0.1/testf1.txt
Connection: keep-alive
```

Sobrescribir el mismo archivo:

```console
$ curl -i -X PUT -d @testf1.txt http://127.0.0.1/testf1.txt
HTTP/1.1 204 No Content
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Connection: keep-alive
```

Bloquear el archivo para evitar sobrescritura:

```console
$ curl -i -X LOCK http://127.0.0.1/testf1.txt
HTTP/1.1 200 OK
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Content-Type: text/xml; charset=utf-8
Content-Length: 392
Connection: keep-alive
Lock-Token: <urn:7502d56f>
```

Intentar sobrescribir el archivo:

```console
$ curl -i -X PUT -d @testf1.txt http://127.0.0.1/testf1.txt
HTTP/1.1 423
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Content-Length: 0
Connection: keep-alive
```

El archivo está bloqueado. Desbloquear el archivo:

```console
$ curl -i -X UNLOCK -H 'Lock-Token: <urn:7502d56f>' http://127.0.0.1/testf1.txt
HTTP/1.1 204 No Content
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Connection: keep-alive
```

Sobrescribir el archivo:

```console
$ curl -i -X PUT -d @testf1.txt http://127.0.0.1/testf1.txt
HTTP/1.1 204 No Content
Server: Angie/|angie_version|
Date: |sampledatelong| 19:15:35 GMT
Connection: keep-alive
```

El archivo ha sido desbloqueado y sobrescrito exitosamente.

<a id="additional-information-7"></a>

## Información adicional

La documentación detallada y el código fuente están disponibles en:
[https://github.com/arut/nginx-dav-ext-module](https://github.com/arut/nginx-dav-ext-module)
