# How to send client ip at bakend using percona-ha

**URL:** <https://forums.percona.com/t/how-to-send-client-ip-at-bakend-using-percona-ha/32417>\
**Category:** PostgreSQL\
**Created:** [August 19, 2024, 9:20am UTC](https://forums.percona.com/t/how-to-send-client-ip-at-bakend-using-percona-ha/32417 "2024-08-19T09:20:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishpilania18](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@ashishpilania18](https://forums.percona.com/u/ashishpilania18)\
**Post date:** [August 19, 2024, 9:20am UTC](https://forums.percona.com/t/how-to-send-client-ip-at-bakend-using-percona-ha/32417/1 "2024-08-19T09:20:26Z")

</div>

I have configured percona cluster and in front of it using percona -ha so to redirect request primary and replica but i want to handle in ha proxy so it should send the client ip at backend and we can whitelist that client ip using pg\_hba.conf

Thanks in advance for the help

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [August 30, 2024, 1:04am UTC](https://forums.percona.com/t/how-to-send-client-ip-at-bakend-using-percona-ha/32417/2 "2024-08-30T01:04:26Z")

</div>

Hi @ashishpilania18,

The following blogpost shows how to set up HA Proxy and Postgres:

> **[PostgreSQL Application Connection Failover Using HAProxy with xinetd](https://www.percona.com/blog/postgresql-application-connection-failover-using-haproxy-with-xinetd/)**
>
> In this post, we discuss how to implement a PostgreSQL application connection failover using HAProxy with xinetd, one of the most traditional approaches.

In particular, check the “_A sample HAProxy configuration file is given below_” section for how to direct traffic to replicas.

---

<div class="post-metadata">

**Author:** ![ashishpilania18](https://avatars.discourse-cdn.com/v4/letter/a/977dab/32.png) [@ashishpilania18](https://forums.percona.com/u/ashishpilania18)\
**Post date:** [September 2, 2024, 8:39am UTC](https://forums.percona.com/t/how-to-send-client-ip-at-bakend-using-percona-ha/32417/3 "2024-09-02T08:39:31Z")

</div>

Dear Agustin

This is not solving the problem as we want HA proxy to send the client IP in the backward and through which we can handle client using pg\_hba.conf as currently it is set for 0.0.0.0/0
