1. Output of caddy version
:
v2.6.1 h1:EDqo59TyYWhXQnfde93Mmv4FJfYe00dO60zMiEt+pzo=
2. How I run Caddy:
Within a Docker container
a. System environment:
Unix (AWS Linux 2 AMI)
b. Command:
See below for Docker run command
c. Service/unit/compose file:
docker run \
--log-driver=fluentd \
--log-opt tag="cl.caddy" \
--log-opt fluentd-address=localhost:24224 \
--restart unless-stopped \
-u ${DOCKER_USER_ID}:${DOCKER_GROUP_ID} \
--name caddy \
-p 8545:8545 \
-p 8546:8546 \
-p 50000:50000 \
-p 50001:50001 \
-v /lw/caddy:/caddy \
-v /lw/caddy/Caddyfile:/etc/caddy/Caddyfile \
-v /lw/caddy:/config/caddy/ \
-v /lw/caddy:/data \
-d caddy:2.6.1
d. My complete Caddy config:
http://rpc-internal:50000 {
respond "internal worked!"
}
http://rpc-external:50001 {
respond "external worked!"
}
http://rpc-balancer:8546 {
reverse_proxy {
to http://rpc-internal:50000 http://rpc-external:50001
lb_policy first
lb_try_duration 5s
lb_try_interval 50ms
}
}
3. The problem I’m having:
I’m trying to run a basic load balancer within Caddy that can proxy to two endpoints (rpc-internal, rpc-external).
“rpc-internal” will eventually be a local docker container, and “rpc-external” will be an external URL on the public internet, but I can’t even get this basic test case of returning a simple string (ie, “external worked!”) correct.
4. Error messages and/or full log output:
"wget localhost:50000" returns HTTP 200, empty response (expecting "internal worked!").
"wget localhost:50001" returns HTTP 200, empty response (expecting "external worked!").
"wget localhost:8546" returns HTTP 200, empty response (expecting "internal worked!" or "external worked!").
5. What I already tried:
See above for the wget commands that I’ve tried. Thank you!!!