Question about Caddy Sometimes Failing

For the past couple of days, I have been running into a strange issue. I am running Caddy v1.0.4. My caddyfile looks like this:

http:// {

  proxy /app2 localhost:7000

  proxy /app1 localhost:5000

  proxy / localhost:8080 {
    websocket
    transparent
  }
 
}

I am running 3 Vue applications. As of this time of writing, the config seems to work perfectly, but at some point yesterday and earlier today, despite no change to the caddyfile, the app1 and/or app2 would fail to load properly for whatever reason (despite them working just find in their original port, for example if went to localhost:5000, it would work just fine, I also restarted the caddy server, but the issue would remain). I would then leave my computer for an hour or so, then all a sudden those application would work. So my question is, does the caddy configuration file get cached somewhere? Or can someone help explain as to what could be possibly causing this issue?

Hi @darkdragon,

Can you elaborate? Specifically, HOW did it fail - did it load part of the page and stop? Did something else come up instead? Did NOTHING show up? Did you get any HTTP status / error? There’s so many different ways something can “fail to load properly” at this stage that without more detail it’s impossible to tell which part of the process is the problem.

Next time this issue occurs, could you post the results of these two commands run from your Caddy host:

curl -IL localhost/app1
curl -IL localhost:5000/app1

(Adapt appropriately if a different backend is failing).

Caddy makes a standard HTTP request to the backend when it tries to proxy to it. In this way it acts almost identically to a browser. If the browser works but Caddy’s proxy doesn’t, it implies some kind of discrimination from the backend server (i.e. the backend app is rejecting only Caddy, or allowing only the browser).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.