1. Caddy version (caddy version
):
v2.5.0
2. How I run Caddy:
systemctl start caddy
a. System environment:
Linux
c. Service/unit/compose file:
Docker-compose.yml
:
services:
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
backend:
image: arquimedia-backend
volumes:
- ./data/backend:/code/static/images
depends_on:
- db
environment:
command: gunicorn Arquimedia.wsgi:application --bind 0.0.0.0:8000
ports:
- 127.0.0.1:8001:8000
frontend:
image: arquimedia-frontend
restart: always
depends_on:
- backend
command: "nginx -g 'daemon off;'"
ports:
- 127.0.0.1:8002:3000
d. My complete Caddyfile or JSON config:
arquimedia.pt, www.arquimedia.pt {
encode gzip zstd
handle /api/* {
uri strip_prefix /api
file_server <project-path>/data/backend/*
@notStatic {
not path /images/*
}
reverse_proxy @notStatic localhost:8001
}
handle {
reverse_proxy localhost:8002
}
}
3. The problem I’m having:
I’m trying to get static files on <project-path>/data/backend
but the response come as a blank page, either for existing files or non existing.