You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement server-side support for the PROXY protocol
Add support for HAProxy's PROXY protocol, versions 1 and 2, so the real
client address can be recovered from connections arriving through a trusted
proxy. The new proxy_networks GUC lists the networks whose peers are allowed
to prepend a PROXY header to declare the originating client. This list
supports unix sockets with the "unix" token. It is empty by default, which
disables the feature.
The header is parsed lazily. The server only looks for it on connections
coming from a trusted network and falls through to the normal startup path
otherwise. Existing clients that are not from the proxy networks and that
do not speak the PROXY protocol are unaffected.
For connections from a trusted proxy, client_addr and client_port in
pg_stat_activity and the host-based authentication checks reflect the
address from the header, while the proxy's own endpoint is exposed via the
new proxy_addr, proxy_hostname and proxy_port columns. The %H and %R
escapes expose the proxy information in log_line_prefix. The proxy host and
port are also emitted in the CSV and JSON log formats.
0 commit comments