Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-24-2012, 10:15 AM   #1
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
Apache behind Nginx proxy not getting HTTP_X_FORWARDED_FOR

One of the developer is not getting the variable HTTP_X_FORWARDED_FOR on Debian Squeeze Apache. Apache server is running behind Nginx (0.6.32) Reverse proxy.

variable HTTP_X_FORWARDED_FOR is ok from couple of places/IP addresses but not happening from one specific client IP(Public IP range).

Nginx configuration is
proxy_set_header   Host   $host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
What can be wrong with that specific IP?. Means, that IP may be behind proxy server as well.? or something else. I googled about the problem and one guy was talking about the possibility of client IP is behind proxy.
That ip is from third party and i have no idea what they are doing or even they would be able give me correct info. I have to tell them & developer as well, what is wrong with 3rd parties IP address.


Last edited by KinnowGrower; 07-24-2012 at 10:19 AM.
Old 07-25-2012, 01:52 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
well what IS the third parties IP address?? surely you have logging and the wherewithal to look at the traffic and see for yourself? tools like tcpdump and wireshark are indespensible for working this sort of thing out. Maybe look at the HTTP headers on the wire too. Maybe this set of config is somehow not being applied to this traffic due to complexities of the networking that you've not appreciated?
1 members found this post helpful.
Old 07-26-2012, 09:32 PM   #3
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Original Poster
Rep: Reputation: 34
Thanks for help. I will try with tcpdump. Actually, i have to find the way how to come from that third parties IP to my network to access Apache behind Nginx. Any way thanks again


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nginx and node.js create proxy server thuananh Linux - Newbie 0 06-04-2012 04:03 AM
how i Install nginx As Reverse Proxy Dr.TrYaG Linux - Server 5 07-03-2011 03:49 AM
Nginx like as a reverse proxy for Apache Abadon_ Linux - Server 0 11-13-2009 04:53 AM
All traffic showed as proxy after installing nginx proxy to apache centosfan Linux - Server 0 10-25-2008 08:41 AM
Determining "HTTP_X_FORWARDED_FOR" in Apache vanquisher Linux - Networking 0 06-27-2004 12:20 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration