问题
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