The ngx_http_requestid_module is designed to generate a unique request identificator. The module sets $request_id variable with a unique request ID. The $request_id variable is composed of (time){13} and (md5(ngx_pid, connection_number, rand())){19}, where: * time - timestamp in milliseconds * ngx_pid - nginx process id * connection_number - connection counter value local to worker process * rand() - random number Supports both old and new configuration methods including dynamic compilation. Example configurations: # Set Proxy Header location / { requestid on; proxy_pass http://127.0.0.1; proxy_set_header X-Request-Id $request_id; } # Set HTTP Header location / { add_header X-Request-Id $request_id; } # Write request id to log log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent $request_id ' '"$http_referer" "$http_user_agent"'; Configuration: syntax: requestid on | off default: off context: server, location