Large files via proxy fail

I’m running Caddy 0.9.5 using it to proxy to a bunch of different servers. All works great except I can’t download larger files without a failure. I tried adding timeouts none to my Caddyfile after all the proxy statements but Caddy fails when I restart it. It looks like it’s treating “timeouts” as a domain that it’s supposed to be getting an SSL certificate for. I tried moving that line around but nothing works. What am I doing wrong here…?

Part of my file:
myexample.mydomain.com {
proxy / 10.1.1.15 {
transparent
}
}
timeouts none

You only need one timeouts none directive in the entire Caddyfile (the effect is server wide), and it needs to be inside a vhost block. e.g:

myexample.mydomain.com {
    proxy / 10.1.1.15 {
        transparent
    }
    timeouts none
}
2 Likes

Yeah, actually I just was about to update - I tried that as well. I got an error on that line "Parse error: Unknown directive “timeouts”.

I get that error on Caddy 0.9.4, seems to work fine on 0.9.5. Double check caddy -version?

The following Caddyfile parses successfully for me on Ubuntu 14.04:

example.com {
    status 200 /
    timeouts none
}
1 Like

Oh fer…jeez, sorry - I thought I was working with 0.9.5, which is what I have on a little Debian VM that I’m using for production. The one I was working with on another machine is actually only 0.9.3. Doh…

So yeah, timeouts none works fine when put in the right place.

2 Likes

Be careful when using timeouts none, I had set that in my Caddyfile too for the same reason, but after a week or two Caddy stopped working correctly, serving some files, not others.

Turned out too many files were open at once, maybe something else is set wrong on my server (need to increase open file limit maybe), but I “fixed” the issue by setting a large timeout, like 24hours, since none of my users needs a connection open longer than this.

That doesn’t sound right – unless your server was being slowloris’ed.

Hmm ok, I’ll set it to none again and see if I can see what was happening.

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