1. The problem I’m having:
I’m trying to add additional reverse proxies (actually handle_path but this is a simple example). The following Caddyfile works fine:
localhost:8443 {
reverse_proxy reveal-vault:8200
reverse_proxy /whoami whoami:80
}
but once I add another reverse_proxy (see below), caddy complains about an unexpected token r
. Now if I run
docker exec -it reveal-caddy caddy fmt --overwrite /etc/caddy/Caddyfile
It returns:
localhost:8443 {
reverse_proxy reveal-vault:8200
reverse_proxy /whoami whoami:80
r
2. Error messages and/or full log output:
Error: adapting config using caddyfile: syntax error: unexpected token 'r', expecting '}', at /etc/caddy/Caddyfile:4 import chain: ['']
3. Caddy version:
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
a. System environment:
b. Command:
docker exec -it reveal-caddy caddy reload -c /etc/caddy/Caddyfile
c. Service/unit/compose file:
services:
caddy:
image: caddy:latest
container_name: reveal-caddy
cap_add:
- NET_ADMIN
ports:
- "8443:8443"
- "8443:8443/udp"
networks:
- frontend
- backend
volumes:
- caddy-data:/data/
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
restart: always
d. My complete Caddy config:
localhost:8443 {
reverse_proxy reveal-vault:8200
reverse_proxy /whoami whoami:80
reverse_proxy /bob whomami:80
}