Welcome! Log In Create A New Profile

Advanced

RE: Log the headers sent by nginx to upstream server

Maxim Ozerov
August 31, 2016 06:52AM
"Log format can contain common variables, and variables that exist only at the time of a log write"
So, other options I do not see, except ngx_http_log_module

But, .. interesting thing is what it means to be overwritten?)

Nginx, some adjustments in request headers, receives from the client:

- Nginx gets rid of any empty headers.
- Ng.By default, will consider any header that contains underscores as invalid.
- The "Host" header is re-written to the value defined by the $proxy_host variable - (ex.: proxy_set_header Host $host;)
- The "Connection" header is changed to "close".

-----Original Message-----
From: nginx [mailto:nginx-bounces@nginx.org] On Behalf Of Sushma
Sent: Wednesday, August 31, 2016 11:18 AM
To: nginx@nginx.org
Subject: Log the headers sent by nginx to upstream server

My client sends a request to nginx with a http header set.
This header is overwritten by nginx before passing along the reqest to the downstream server.
I want to log the header after modification by nginx.
I understand that we can log the header sent by client using "$http_<header_name>".
Is there some embedded variable or some other way I can use which will log the header sent to the downstream server?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269300,269300#msg-269300

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Log the headers sent by nginx to upstream server

Sushma August 31, 2016 04:17AM

RE: Log the headers sent by nginx to upstream server

Maxim Ozerov August 31, 2016 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 302
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready