# Nginx not showing client ip

**URL:** <https://www.ruby-forum.com/t/nginx-not-showing-client-ip/224382>\
**Category:** NGINX\
**Created:** [November 9, 2012, 2:12pm UTC](https://www.ruby-forum.com/t/nginx-not-showing-client-ip/224382 "2012-11-09T14:12:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 9, 2012, 2:12pm UTC](https://www.ruby-forum.com/t/nginx-not-showing-client-ip/224382/1 "2012-11-09T14:12:10Z")

</div>

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:

> **[nginx not showing client ip](https://forum.nginx.org/read.php?2,232641,232641#msg-232641)**
>
> 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 ?

---

<div class="post-metadata">

**Author:** ![piyushbj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3e96dc/32.png) [@piyushbj](https://www.ruby-forum.com/u/piyushbj)\
**Post date:** [November 12, 2012, 12:39pm UTC](https://www.ruby-forum.com/t/nginx-not-showing-client-ip/224382/2 "2012-11-12T12:39:53Z")

</div>

Dear Jonathan,

Thanks for your reply.

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

> **[Client-ip not logged on application server when using ARR](https://iis-blogs.azurewebsites.net/anilr/client-ip-not-logged-on-content-server-when-using-arr)**
>
> I have been meaning to blog for a while, but something always seems to get in the way.  So, here is my first blog post.
> Let me first introduce myself.  I have been a developer on the IIS …

Posted at Nginx Forum:

> **[Re: nginx not showing client ip](https://forum.nginx.org/read.php?2,232641,232730#msg-232730)**
>
> 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 ?

---

<div class="post-metadata">

**Author:** ![piyushbj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3e96dc/32.png) [@piyushbj](https://www.ruby-forum.com/u/piyushbj)\
**Post date:** [November 9, 2012, 4:23pm UTC](https://www.ruby-forum.com/t/nginx-not-showing-client-ip/224382/3 "2012-11-09T16:23:05Z")

</div>

On 9 November 2012 13:11, piyushbj [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

> **[DevCentral](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

, 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 M. // Oxford, London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
