Skip to content

Commit d3f053b

Browse files
committed
Get rid of unnecessary request_id_header command
1 parent da2c0bd commit d3f053b

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ USAGE
1515

1616
1) Add `--add-module=../git/nginx-x-rid-header` to your nginx configure command. On Linux, you should also add `--with-ld-opt=-lossp-uuid` or whatever flavor of uuid-devel comes with your distribution. Now `make` and `make install`.
1717

18-
2) At the http {} level of you config file, add the argument-less directive `request_id_header;`
19-
20-
3) You now have access to a `$request_id` variable. Suggested use:
18+
2) You now have access to a `$request_id` variable. Suggested use:
2119

2220
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" - $connection $request_time $upstream_cache_status $request_id';
2321
server {
@@ -29,4 +27,4 @@ USAGE
2927
}
3028
}
3129

32-
4) On your backend (8080), you can pull the request header `x-exampledotcom-rid`, and log it or tie it to whatever you may like. This makes it really easy to correlate backend exceptions or instrumentation with frontend http request logs.
30+
3) On your backend (8080), you can pull the request header `x-exampledotcom-rid`, and log it or tie it to whatever you may like. This makes it really easy to correlate backend exceptions or instrumentation with frontend http request logs.

ngx_x_rid_header_module.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// TODO:
1717
//
1818
// * make the name of the variable configurable
19-
// * is there a more portable way of getting uuid in here?
2019

2120
ngx_int_t ngx_x_rid_header_get_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) {
2221
u_char *p;
@@ -86,17 +85,7 @@ static ngx_http_module_t ngx_x_rid_header_module_ctx = {
8685
NULL /* merge location configuration */
8786
};
8887

89-
char* ngx_x_rid_header_conf(ngx_conf_t* cf, ngx_command_t* cmd, void* conf) {
90-
return NGX_CONF_OK;
91-
}
92-
9388
static ngx_command_t ngx_x_rid_header_module_commands[] = {
94-
{ ngx_string("request_id_header"),
95-
NGX_HTTP_MAIN_CONF|NGX_CONF_NOARGS,
96-
ngx_x_rid_header_conf,
97-
NGX_HTTP_MAIN_CONF_OFFSET,
98-
0,
99-
NULL },
10089
ngx_null_command
10190
};
10291

0 commit comments

Comments
 (0)