Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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;  #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

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
I was trying to avoid sniffing this encrypted traffic, but that is what I asked for, thanks. – Eric Fortis May 22 '12 at 6:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.