caddy: Change in proxy config not reflected by in-process restart (http2 keep-alive connection not closed)

1. What version of Caddy are you running (caddy -version)?

master

2. What are you trying to do?

Reload Caddyfile with new proxy setting with USR1 using in-process restart.

3. What is your entire Caddyfile?

Before:

www.example.com (domain must be served on https, e.g. let's encrypt)

proxy / www.google.com {
        proxy_header Host {host}
        proxy_header X-Real-IP {remote}
        proxy_header X-Forwarded-For {remote}
        proxy_header X-Forwarded-Proto {scheme}
}

After:

www.example.com

proxy / www.yahoo.com {
        proxy_header Host {host}
        proxy_header X-Real-IP {remote}
        proxy_header X-Forwarded-For {remote}
        proxy_header X-Forwarded-Proto {scheme}
}

4. How did you run Caddy (give the full command and describe the execution environment)?

caddy

5. What did you expect to see?

After kill -USR1 on caddy pid, should show error page of Yahoo instead of Google.

6. What did you see instead (give full error messages and/or log)?

Still showing error page of Google.

7. How can someone who is starting from scratch reproduce this behavior as minimally as possible?

  1. Start caddy with Caddyfile proxying Google
  2. Change Caddyfile to proxy Yahoo
  3. kill -USR1 CADDY_PID
  4. Observe caddy still proxying Google

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 28 (5 by maintainers)

Most upvoted comments

Good to know; I’m not sure if this is a “hack” or behavior I want to introduce into Caddy at this time, but thank you for finding it out! Will probably reference this in the future.