Welcome! Log In Create A New Profile

Advanced

How to log all HTTP header?

Posted by kevin_bolton 
How to log all HTTP header?
June 06, 2019 12:06AM
Hi

In order to analysis hacker activity, I need to recode fully HTTP request.
Not only method, uri, body but also headers.

Module ngx_http_core_module provide $http_name to get one header, but not all.
How do I do it?

Kevin
Re: How to log all HTTP header?
August 25, 2019 10:56AM
How about setting a variable "headers_all" to a Javascript function that collects all headers from request.headersIn[] and returns the concatenated string in some defined format? You can include that variable in your logs.

Cheers,
--j.
Re: How to log all HTTP header?
August 28, 2019 09:01AM
And as I had to find out myself just now, this suggestion I made does not work because you cannot enumerate the elements of the special objects r.variables and r.headersIn.

It does work if you want to write a bit of code for a new module :-)

Sorry,
--j.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready