File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.19.5-3
4+
5+ * Set or forward ` X-Request-ID ` .
6+ * Add computed ` X-Request-ID ` to the access logs.
7+
38## 1.19.5-2
49
510* Forward ` X-Forwarded-* ` headers to upstream correctly.
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ http {
3030 '' $server_port;
3131 }
3232
33+ # If we receive X-Request-ID, pass it through; otherwise, pass along the
34+ # request_id generated by nginx
35+ map $http_x_request_id $proxy_x_request_id {
36+ default $http_x_request_id;
37+ '' $request_id;
38+ }
39+
3340 proxy_http_version 1.1;
3441 proxy_set_header Connection "";
3542 proxy_set_header Host $host;
3946 proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
4047 proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
4148 proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
49+ proxy_set_header X-Request-ID $proxy_x_request_id;
4250 proxy_set_header X-Forwarded-Host $host;
4351
4452 proxy_read_timeout 600s;
Original file line number Diff line number Diff line change 11log_format main '$remote_addr - $remote_user [$time_local] $status '
22 '"$request" $body_bytes_sent "$http_referer" '
3- '"$http_user_agent" "$http_x_forwarded_for"';
3+ '"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id ';
44
55access_log /dev/stdout main;
66error_log /dev/stdout warn;
You can’t perform that action at this time.
0 commit comments