# CDN Docker con Nginx + WebDAV básico

## Preparar usuario de subida

```bash
htpasswd -c nginx/.htpasswd admin
```

Si no tienes htpasswd:

```bash
sudo apt install apache2-utils
```

## Local

```bash
docker compose -f docker-compose.local.yml up -d
```

Disponible en:

```text
http://localhost:8090/
```

## Producción

```bash
docker compose -f docker-compose.production.yml up -d
```

El contenedor solo escucha en `127.0.0.1:8090`, pensado para usarlo detrás de Nginx/Plesk.

## Subir archivo

```bash
curl -v -u admin:TU_PASSWORD -T archivo.glb http://localhost:8090/upload/archivo.glb
```

Disponible públicamente en:

```text
http://localhost:8090/archivo.glb
```

## Subir a carpetas

```bash
curl -v -u admin:TU_PASSWORD -T modelo.glb http://localhost:8090/upload/orbital_courses/raw/modelo.glb
```

Disponible en:

```text
http://localhost:8090/orbital_courses/raw/modelo.glb
```

## Nota sobre permisos

El compose ejecuta al arrancar:

```bash
chown -R nginx:nginx /data
chmod -R u+rwX,g+rwX /data
```

Esto evita el error `403` después de autenticarse correctamente.
