Similar to this question and this question, I have a client (bazel) that is sending requests to nginx.
The client is adding a custom header called build_id
as HTTP_BUILD_ID
to each request.
I just want to log this header from nginx
.
I wrote a small python flask
application and printed all the headers and it showed that HTTP_BUILD_ID
is indeed part of the request.
Unfortunately, nginx
can't find it. This is what my log_format looks like with the addition of $http_build_id
.
log_format main '$remote_addr - $upstream_cache_status [$time_local]
'"$request" $status $body_bytes_sent '
'[$http_build_id]'
'"$http_referer" "$http_user_agent"';