reverse proxy to postgresql with haproxy - Mailing list pgsql-general

From Aviel Buskila
Subject reverse proxy to postgresql with haproxy
Date
Msg-id CAB3=tTE1sEMaCK9m=YLmrHFy06U04yBEZxCe99aemrDAUACfKw@mail.gmail.com
Whole thread Raw
Responses Re: reverse proxy to postgresql with haproxy
List pgsql-general
Hey everyone, 
I am trying to configure reverse proxy to postgresql using haproxy, for this example I have the following architecture:
- node1
- node2 
- haproxysrv

Streaming replication between node1 and node2 and auto failover with repmgr.

When I issue a connection to haproxysrv to connect, I get a pg_hba.conf error telling that I haven't configured the haproxysrv to connect to the database. 

The reason that this scenario occurs is that:
HAProxy establishes 2 separate connections, 1 between the client and haproxy and one between haproxy and postgresql. the connection made haproxy haproxy and postgresql contains source ip of the haproxy itself.

HAProxy offers a "transparent" ip using proxy protocol.

According to haproxy docs and forums this feature is feasible only if the application is proxy protocol aware.

My question are:
1. is there any other solution for this issue?
2. is there anyone who knows if postgresql is proxy protocol aware?

Best regards,
Aviel B.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Fatal error when not numeric value - PostgreSQL 9.2
Next
From: arnaud gaboury
Date:
Subject: Re: query from two tables & concat the result