Opened 6 weeks ago

Closed 6 weeks ago

#2027 closed defect (invalid)

How to add a log_format structure as a header in Nginx

Reported by: sakshamnsit66@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.19.x
Keywords: Cc:
uname -a: Linux nginx-dev 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 1 00:13:43 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx/1.13.6

Description

I want to provide a set of headers in one go via proxy_set_headers.

log_format test-profle escape=json '{'

'"received_bytes":"$request_length",'

'"sent_bytes":"$body_bytes_sent",'
'"request":"$request",'
'"ssl_cipher":"$ssl_cipher",'
'"ssl_protocol":"$ssl_protocol",'
'"user_agent":"$http_user_agent

'}';

proxy_set_header X-METADATA test-profle;

proxy_set_header by default provide 2 sets of operations

proxy_set_header Host $host;
proxy_set_header Accept-Encoding "";
2nd one will not passed to the proxied server.

How to solve the above stated problem. Do i need to create a new custom_set_header?

Change History (1)

comment:1 by Maxim Dounin, 6 weeks ago

Resolution: invalid
Status: newclosed

For questions on how to configure nginx, please use support options available.

Note: See TracTickets for help on using tickets.