Default values for directives?

1. Caddy version (caddy version):

2. How I run Caddy:

a. System environment:

b. Command:

c. Service/unit/compose file:

d. My complete Caddyfile or JSON config:

3. The problem I’m having:

In the documentation for Caddyfile configuration, I have not discovered how to tell the default values unless it explicitly says “Default:”, but not all directives do this. How can tell what the default value is?

4. Error messages and/or full log output:

5. What I already tried:

6. Links to relevant resources:

What I’ve found is that there really are not defaults beyond the items documented in the directives section of the caddyfile documentation, and some of them are based on parent configuration directives being set, that have default values under them.

Is there a specific configuration pattern you are trying to understand?

1 Like

Please fill out the help topic template, we can’t really help with vague questions like this.

Not at this time. But, for example, what is the default for read_buffer? http_transport

It uses the default from the Go stdlib, i.e. 4KiB: http package - net/http - pkg.go.dev

1 Like

So if a default is not given in the Caddy docs, then we refer to the Go docs?

1 Like

Basically. It’s an oversight though, and you’re the first to have pointed it out. I’ll fix the docs soon.

2 Likes

Made a PR for the docs:

Keep in mind that not all of those timeout values are correct as of v2.4.6, because some of them are being adjusted for v2.5.0 (specifically dial_timeout). See reverseproxy: Adjust defaults, document defaults by francislavoie · Pull Request #4436 · caddyserver/caddy · GitHub

1 Like