# Client IP not showing in frame source

**URL:** <https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795>\
**Category:** Help!\
**Created:** [July 31, 2018, 7:53am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795 "2018-07-31T07:53:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [July 31, 2018, 7:53am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/1 "2018-07-31T07:53:52Z")

</div>

Hi,  
I have an HA Proxy instance setup on 2 virtual servers.  
I have setup a Virtual IP as the frontend that recieves incoming requests on port 8080 and forwards them to 2 separate backend proxy servers on the same port.

the setup is working however when I try to access it, it shows me the IP address of the proxy server instead of the client machine IP, in the page source of the client machine.

I need to ensure that the client IP is displayed correctly in the page source of the client PC .

Any help will be appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [August 1, 2018, 4:58am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/2 "2018-08-01T04:58:32Z")

</div>

Hi,

Can anyone help me out over here?

FWIW, I tried using the source 0.0.0.0 usersrc clientip parameter in a bid to resolve this issue.

I also tried using option forwardfor except 127.0.0.1 in the frontend section and option forwardfor header X-client parameter in the backend section of the file, but this does not work.

I can share the configuration if required.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 1, 2018, 8:12am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/3 "2018-08-01T08:12:13Z")

</div>

You also need to configure your backend server to consider the X-forward-for header.

---

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [August 1, 2018, 10:19am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/4 "2018-08-01T10:19:55Z")

</div>

Thank you for your response.

Please forgive me as I am a newbie to HA proxy.

This is the configuration file for HA Proxy.

global  
log /dev/log local0 info  
log /dev/log local1 notice  
maxconn 30000

defaults  
mode http  
log global  
option dontlognull  
timeout connect 10000  
timeout client 45000  
timeout server 240000  
maxconn 50000  
option forwardfor except 127.0.0.1

frontend web-proxy  
bind 10.250.4.91:8080 transparent  
mode http  
http-request set-header X-Real-IP %[src]  
option forwardfor  
option httplog  
timeout client 15s  
default\_backend proxyservers

backend proxyservers  
mode http  
balance roundrobin  
http-request set-header X-Real-IP %[src]  
option forwardfor  
timeout server 30s  
timeout connect 4s  
server PROXY-1 10.250.4.11:8080 check fall 2 inter 10000 rise 2  
server PROXY-2 10.250.4.78:8080 check fall 2 inter 10000 rise 2

listen status 10.250.4.88:8081  
mode http  
stats enable  
stats uri /hastatus  
stats auth admin:123456

In your post , you mentioned that I will need to configure my backend server to consider the X-forward for header.  
Where do I need to insert this parameter?  
Do I need to install HA proxy on these servers as well?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 1, 2018, 10:45am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/5 "2018-08-01T10:45:55Z")

</div>

No, you need to configure the webserver on your backend to consider the X-Forwarded-For header. How this can be achieved, if possible at all and what the configuration would look like depends on what the backend server software this actually is.

---

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [August 2, 2018, 4:32am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/6 "2018-08-02T04:32:57Z")

</div>

Once again thank you for you prompt response.

The backend servers are essentially proxy servers which run Websense.

Your reply indicates that I will have to ask forcepoint to help me find out how to consider the X-Forwarded-for header in this case.

---

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [August 13, 2018, 6:01am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/7 "2018-08-13T06:01:43Z")

</div>

Hi,

In your previous post, you had mentioned that I will need to configure the webserver on my backend to consider the X forwarded for header.

The backend servers over here run websense by forcepoint.

Can you let us know how to configure websense to consider the X Forwarded for header?

Alternatively, can you please let us redirect us to a link that shows us how this can be achieved?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 13, 2018, 11:50am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/8 "2018-08-13T11:50:12Z")

</div>

I don’t have that information. I suggest you contact the vendor.

---

<div class="post-metadata">

**Author:** ![Skinnyguinea](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Skinnyguinea](https://discourse.haproxy.org/u/Skinnyguinea)\
**Post date:** [August 14, 2018, 5:54am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/9 "2018-08-14T05:54:42Z")

</div>

Sorry if this sounds like a stupid question.

By vendor, do you mean websense/forcepoint?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [August 14, 2018, 8:01am UTC](https://discourse.haproxy.org/t/client-ip-not-showing-in-frame-source/2795/10 "2018-08-14T08:01:47Z")

</div>

Yes, thats what I mean.
