This page is about Caddy 1 and will go away soon because Caddy 2 is now available. Click here for Caddy 2.

User Guide

http.timeouts

timeouts configures Caddy's HTTP timeouts:

Timeouts are an important way to maintain server connectivity in the face of buggy or malicious clients.

Because timeouts apply to an entire HTTP server which may serve multiple sites defined in your Caddyfile, the timeout values for each site will be reduced to their minimum values (with 0 or none being the lowest) across all sites that share that server. It's a good idea to keep your timeouts the same or just set them on one site to avoid confusion. A timeout set on one site will apply to all sites that share that server.

Syntax

To set all the timeouts to the same value:

timeouts val

You can also configure each timeout individually:

timeouts { read val header val write val idle val }

Valid values are durations, or 0 or none to disable the timeout if it was previously enabled.

Examples

Set all timeouts to 1 minute:

timeouts 1m

Set custom read timeout and write timeouts:

timeouts { read 30s write 20s }

Need help with this feature?

Join us in the Caddy forum, where the open source community gathers to share their knowledge.

Does your company use Caddy?

Purchase a commercial license to use Caddy with your business and for basic email support, along with other benefits!