1

There is a hardware LB redirecting http to an Nginx SSL Offloader listening only at 443. I have no access to the LB, but I need to verify if it is injecting the X-Forwarded-For header.

Why? I'm trying to log the client IP with http {

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

and server {

access_log    logs/access.log main;
set_real_ip_from       10.10.10.10;  #LB VirtualService IP
real_ip_header     X-Forwarded-For; 

but it is not logging. What I'm missing here?

P.D. Nginx 1.0.14 compiled --with-http_realip_module

Eric Fortis
  • 378
  • 2
  • 6

1 Answers1

2

To verify that the requests have the correct header as they reach the server, grab the traffic with tcpdump and inspect the HTTP request headers directly.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251