Nginx - Access Http custom headers

那年仲夏 提交于 2019-12-11 08:07:56

问题


I have a simple requirement. I have a nginx web server and a netscaler proxy. From netscaler, the option Client_IP header is checked, and name of header is HTTP_CLIENT_IP.

I want to access this ip in nginx log. I have specified a custom log format, so i can access this value:

I have tried the following variables in the log format, and they just return in '-'.

$http_client_ip
$http_request_body

Basically, i want to read the entire request header / body that nginx receives from netscaler.

Any help would be appreciated !


回答1:


Netscaler inserts a http header with the client ip, if enabled. However You have to configure the http header name on the netscaler.



来源:https://stackoverflow.com/questions/37307443/nginx-access-http-custom-headers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!