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.