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.request_id

request_id generates a UUID which can be referenced via the {request_id} placeholder, for use in many other directives including header and log

When request_id is used, the {request_id} placeholder will have a value; otherwise it will be empty.

Syntax

request_id [header_field]

Examples

Set the request ID in a response header:

request_id header / Caddy-Request-Id {request_id}

Read the request ID from a request header called X-Request-ID, if present:

request_id X-Request-ID

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!