Skip to content

caddy reload command returns successfully but does not work #5735

@knacky34

Description

@knacky34

Environement

  • Podman
  • Image: Caddy-2.7.2-alpine

Step to reproduce

  1. Create Caddyfile :
http://localhost
respond "Hello World"
  1. Create container :
podman run -d \
	-v path/to/Caddyfile:/etc/caddy/Caddyfile:ro \
	-v /srv:/srv:ro \
	-v caddy_data:/data \
	-v caddy_config:/config \
	-p 80:80 \
	--name caddy docker.io/caddy-alpine
  1. run curl localhost, output Hello World
  2. Modify Caddyfile's respond line to respond "Goodbye World"
  3. Run podman exec -w /etc/caddy caddy caddy reload
  4. curl localhost, output Hello World instead of Goodbye World

Workaround
Restart the container with podman restart caddy

Log Output after run caddy reload

{"level":"info","ts":1691840974.3116052,"logger":"admin.api","msg":"received request","method":"POST","host":"localhost:2019","uri":"/load","remote_ip":"127.0.0.1","remote_port":"54268","headers":{"Accept-Encoding":["gzip"],"Content-Length":["230"],"Content-Type":["application/json"],"Origin":["http://localhost:2019"],"User-Agent":["Go-http-client/1.1"]}}
{"level":"info","ts":1691840974.3117096,"msg":"config is unchanged"}         # <-- Seems that it does not detect the value of respond changed
{"level":"info","ts":1691840974.311715,"logger":"admin.api","msg":"load complete"}

Also Tried
Seeing the log output, I think maybe it does not detect a change of the value in respond. So I tried adding a new directive, but it still does not work. Furthermore, the log output still say config is unchanged

  1. Edit Caddyfile and add header Custom-Header "My value"
  2. Run podman exec -w /etc/caddy caddy caddy reload
  3. Run curl -v localhost, I should see the newly added header in the response but it's not there

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions