Apologies for deleting the template. It is difficult for me to word my question using the template.
I have experienced many times now when developing my caddy configurations that sometimes my changes simply don’t get reflected when I restart the server to pick up my Caddyfile changes.
Visit localhost/specific/path in my browser, expect to see “hello”. Instead I see the reverse_proxy to “https://www.somewhere.com”
I think I’m going crazy for half an hour, and then I decide to re-create this exact same Caddyfile in a different directory, and caddy run from there. Visit localhost/specific/path and voila, I get “hello”!
So my question is: Does Caddy have some sort of cache where it remembers the directives and their results or something? If so, is there a way to clear it?
My caddy version is v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
I don’t think it’s a browser cache issue because I even opened up Safari which I have never used to visit localhost, and I still see the Caddyfile result.
There are caching modules available for content, but no, Caddy doesn’t cache this kind of thing. It does autosave the current running configuration (for example if you modify it via the API), but it only resumes that if you specify the --resume flag.
You could try caddy reload --config ./Caddyfile or something like that to tell Caddy more specifically, hey, I want you to load this new config right here (to eliminate it maybe finding another config in a default location, perhaps?).
Never hurts to pgrep caddy after killing it to be super sure there’s not a second one running on the old config, still, too.
You didn’t fill out the help topic template, so we don’t know how you installed or ran Caddy. That’s precisely the information we need to help, and why the template is mandatory as part of the forum rules.
That doesn’t really answer the fundamental reason that went wrong. You shouldn’t be running Caddy directly if you installed Caddy as a systemd service for example. But I have to make an assumption with that because you didn’t say how you installed Caddy. We could help you by explaining what you did wrong, but we can only do that if you give us the requisite context.