1. My Caddy version (caddy -version
):
Caddy version: v1.0.4
2. How I run Caddy:
I run Caddy on an Alpine Docker container, with custom config files for API proxying. I’m intending to run this setup on a ECS Fargate infrastructure to replace an AWS API Gateway/Lambda setup.
a. System environment:
Docker Alpine latest
b. Command:
N/A
c. Service/unit/compose file:
N/A
d. My complete Caddyfile:
(keep in mind this won’t be the definitive config, I’m just working on a PoC)
Caddyfile:
:8080 {
status 200 /health
log stdout
errors
import ./Caddyfile.users
}
Caddyfile.users:
proxy /test http://httpbin.org/get {
without /test
transparent
}
3. The problem I’m having:
I’m migrating from AWS API Gateway to a Docker setup, and I wanted to use Caddy as an API manager of sorts. Right now I’ve got that going on, but I need to validate API keys inside Caddy (since they cannot be validated in the microservices).
Since it’s a API Gateway migration, we need to keep it compatible with current users, so I need to validate that a custom header (X-API-Key
) has a specific value (which could be static, or read from the environment).
I cannot find anything like that anywhere, so I was wondering if maybe I had to write a plugin for it?
4. Error messages and/or full log output:
N/A
5. What I already tried:
- Basic Auth
- JWT
6. Links to relevant resources:
N/A