Our https requests sending new header "X-XSRF-TOKEN" to the Nginx. Some time the header coming "= null" to my backend servers.
MY question, is there any option to see this header in my access.log?
how can i make sure that the Nginx is not blocking the header.
I have to say 98% from the request, they are coming with correct value.
Thanks!
Of course, you can define any custom access log format and use any of the available nginx internal variables. The default nginx log format is:
log_format  combined  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
Just define a new access log format and add the $http_x_xsrf_token variable to it:
log_format  debug     '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" "$http_x_xsrf_token"';
access_log  /var/log/nginx/access_log  debug;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With