The working mechanism behind the Proxy Protocol
This section describes how AxoSyslog supports the Proxy Protocol.
The working mechanism behind the Proxy Protocol
When using the Proxy Protocol during load balancing, AxoSyslog detects the information behind connections connected to the load balancer, then parses the injected information into the following macros:
Data | Macro in version 4.9 and earlier | Version 4.10 and later |
---|---|---|
Source IP of the proxy | PROXY_SRCIP |
SOURCEIP |
Source port of the proxy | PROXY_SRCPORT |
SOURCEPORT |
Destination IP of the proxy | PROXY_DSTIP |
DESTIP |
Destination port of the proxy | PROXY_DSTPORT |
DESTPORT |
Note
Consider the following about macros and headers:
-
When the proxy protocol header is
PROXY UNKNOWN
, no additional macros are added. -
When AxoSyslog cannot parse a proxy protocol header, the connection is closed:
[2020-11-20T17:33:22.189458] PROXY protocol header received; line='PROXYdsfj' [2020-11-20T17:33:22.189475] Error parsing PROXY protocol header; [2020-11-20T17:33:22.189517] Syslog connection closed; fd='13', client='AF_INET(127.0.0.1:51665)', local='AF_INET(0.0.0.0:6666)' [2020-11-20T17:33:22.189546] Freeing PROXY protocol source driver; driver='0x7fffcba5bcf0' [2020-11-20T17:33:22.189600] Closing log transport fd; fd='13'
Note
Originally, the driver supported version 1 of the PROXY protocol (TCP4, TCP6, and TLS connections). PROXY protocol v2 support is available in AxoSyslog version 4.1 and later.
Last modified February 27, 2025: Merge pull request #110 from axoflow/strptime-formatting-fix (2f838bd)