Forum: NGINX nginx not showing client ip

Posted by piyushbj (Guest)
on 2012-11-09 14:12
(Received via mailing list)
Dear All,

I have setup nginx reverse proxy with IIS webserver.

Client ---> Nginx RP ---> IIS 7

But i am unable to get client ip on IIS server's log. i am getting Ngnix
server's ip.

Can anybody help me to achieve this ?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,232641,232641#msg-232641
Posted by Jonathan Matthews (Guest)
on 2012-11-09 16:23
(Received via mailing list)
On 9 November 2012 13:11, piyushbj <nginx-forum@nginx.us> wrote:
> Dear All,
>
> I have setup nginx reverse proxy with IIS webserver.
>
> Client ---> Nginx RP ---> IIS 7
>
> But i am unable to get client ip on IIS server's log. i am getting Ngnix
> server's ip.

That's because the nginx server *is* the one making the connection to
the IIS instance.

You need to teach your application about the X-Forwarded-For (X-F-F)
HTTP header, or tell IIS to log this header in place of the client IP.
Failing that, you could look at using something like
https://devcentral.f5.com/weblogs/Joe/archive/2009...
, but that's kind of overkill IMHO.

For all of these, you'll need to add the client's IP to the X-F-F
header in nginx. A bit of very simple googling should teach you how to
achieve this.

HTH,
Jonathan
--
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html
Posted by piyushbj (Guest)
on 2012-11-12 12:39
(Received via mailing list)
Dear Jonathan,

Thanks for your reply.

Now my problem has been resolved with the help of  below URL  :-

http://blogs.iis.net/anilr/archive/2009/03/03/clie...

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,232641,232730#msg-232730
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.