Skip to content

Allow request id to be populated from specified HTTP request header #50290

@pboguslawski

Description

@pboguslawski

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

According to

and
$_SERVER['UNIQUE_ID'] ?? '',
NC server use mod_uniq_id or random value to identify HTTP request. One cannot specify name of HTTP request header to get this ID from (i.e. to use ID generated by reverse proxy for log correlation).

Describe the solution you'd like
Introduce config parameter (i.e. request_id_header); when defined and not empty, check if request contains such header with non-empty value and use it as request id in NC server; otherwise use UNIQUE_ID if defined, otherwise generate random id.

Describe alternatives you've considered

Dirty workaround for Apache to use request IDs from X-Request-ID header set by reverse proxy:

# Set UNIQUE_ID from X-Request-ID header to simulate mod_unique_id behavior.
SetEnvIfNoCase ^X-Request-ID$ "(.+)" UNIQUE_ID=$1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions