# PROXY Protocol

PROXY Protocol is a connection-metadata format that lets a proxy or load balancer convey original client and destination information to a backend.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/proxy-protocol

> When a load balancer creates a separate connection to a backend, the backend may see the load balancer's address instead of the client's address. PROXY Protocol carries the original connection details ahead of application data, allowing compatible backends to use them for logging, access controls, and troubleshooting.

Practice exams covering PROXY Protocol: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty).

## 6 key aspects of PROXY Protocol

PROXY Protocol preserves connection context across proxy boundaries through an explicitly supported metadata header that requires compatible receivers and a trusted network path.

1. **Original connection metadata**: Carries source and destination addressing information across a proxy boundary. Backends can use the reported client address even when their transport peer is the load balancer.
2. **Version-specific encoding**: Version 1 uses a text header; version 2 uses a binary header and can include additional type-length-value metadata. Configure the sender and receiver for compatible versions rather than assuming support for one implies support for both.
3. **Explicit backend compatibility**: The receiving listener must parse the header before processing application traffic or initiating its TLS handshake. Enabling the load-balancer option alone can break an otherwise healthy application.
4. **Trusted-proxy boundary**: The protocol does not authenticate the claimed client identity. Limit access to trusted proxies and ensure application access-control logic does not accept arbitrary client-supplied metadata.
5. **Distinct from source IP preservation**: PROXY Protocol conveys an address inside connection metadata rather than preserving it in the backend packet's source field. Application logs can use that metadata, but packet-level security rules still evaluate the actual network headers.
6. **Independent load-balancing setting**: This option does not select targets, provide session affinity, or distribute traffic across Availability Zones. Evaluate those settings independently and test health checks whenever changing header handling.

## Cloud services for PROXY Protocol

A Network Load Balancer or Classic Load Balancer can forward traffic to applications or reverse proxies running on Amazon EC2 while adding original connection metadata. The load balancer determines the available protocol version: version 2 for Network Load Balancer and version 1 for Classic Load Balancer. The receiving software must parse that version before processing TLS or application data. Engineers should coordinate sender and receiver configuration, restrict direct backend access, verify that logs use the recovered client address, and test health checks separately from real client connections.

- **[Amazon EC2](https://blowstack.com/tools/cloud-services-hub/amazon-ec2)**: EC2 instances can host PROXY-aware receivers such as HAProxy, NGINX, or compatible application servers behind a load balancer. EC2 itself does not parse the header; the software running on the instance must do so, and network controls should restrict access to trusted senders.

## PROXY Protocol exam questions

Real practice exam questions on PROXY Protocol, with the correct answer and its explanation.

### Question 1 (ANS-C01)

**Question:**

A SaaS provider exposes a custom TLS-over-TCP service to customers through AWS PrivateLink. The endpoint service uses a Network Load Balancer with a TCP listener and an IP target group containing EC2 instances. TLS must terminate only on these instances. For security auditing, each instance must record both the original client's IP address and the VPC endpoint ID through which the connection arrived. Currently, the instances record only load balancer addresses. The server software supports a configurable PROXY-aware TLS listener. Which configuration meets all requirements?

**Correct answer:** Enable PROXY Protocol v2 on the target group. Configure the instance listener to consume the PROXY header before processing the TLS handshake and log the source address and VPC endpoint ID from the header's metadata.

**Explanation:** Network Load Balancer supports PROXY Protocol v2 through the target-group attribute proxy_protocol_v2.enabled. For PrivateLink traffic, the header supplies client connection information and an AWS-specific type-length-value field containing the VPC endpoint ID. With a TCP listener, the header precedes the TLS handshake, so the target must parse it before passing the remaining stream to TLS. TLS still terminates only on the instances.

## Practice PROXY Protocol in a full exam

Questions on PROXY Protocol in each practice exam, with every answer option and an explanation for each:

- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 1 question

## What is PROXY Protocol

PROXY Protocol solves a common problem in proxied network architectures: the transport connection reaching an application does not necessarily identify the original client. A load balancer can accept a client connection and establish another connection to a target, making the load balancer appear to be the source. PROXY Protocol adds metadata describing the original connection, typically including source and destination addresses and ports. It conveys this information to the receiving application without changing the source address in the backend connection's IP packets.

The two main versions have different encodings. Version 1 uses a human-readable text line, while version 2 uses a binary header and supports optional type-length-value fields for additional metadata. For TCP connections, the sender places the header at the beginning of the backend connection, before application data. The receiver must explicitly support the version being sent and consume the header before handing the remaining bytes to its application-protocol parser.

For example, an organization might place a TCP load balancer in front of an NGINX or HAProxy fleet serving a custom application. If targets see only the load balancer's source address, client-based audit records and rate limits become misleading. Enabling PROXY Protocol on the load balancer and its backend listener lets the proxy recover the reported client address. The application or proxy must then be configured to use that recovered address rather than automatically treating the socket peer address as the end user.

In AWS, Network Load Balancer supports PROXY Protocol version 2 through the target-group attribute proxy\_protocol\_v2.enabled. Classic Load Balancer supports version 1 through a policy associated with the relevant backend ports for TCP or SSL listeners. Application Load Balancer instead provides HTTP client-address information through headers such as X-Forwarded-For; it does not provide PROXY Protocol support. For exam questions, distinguish the load balancer type, supported protocol version, backend compatibility, and whether native client IP preservation already meets the requirement.

PROXY Protocol is not an HTTP header and does not require HTTP inspection. With TLS passthrough over TCP, its header precedes the TLS ClientHello on the backend connection. The backend must therefore parse the PROXY header before starting TLS processing. Sending it to a listener that expects TLS or application data immediately commonly causes handshake failures or malformed-request errors. Conversely, a listener requiring the header can reject ordinary connections that omit it.

The metadata is not inherently authenticated or encrypted. Restrict access to PROXY-aware backend listeners to trusted senders, using appropriate security groups, firewall rules, and network isolation. Otherwise, a client that can connect directly may supply forged client-address information. The reported address also does not change what security groups or network ACLs observe in packet headers.

Validate health checks and application traffic separately during deployment. For Network Load Balancer, enabling version 2 also adds PROXY headers to health-check connections, but those headers do not carry client connection information. Finally, do not confuse this option with cross-zone load balancing, sticky sessions, or routing algorithms: those control traffic distribution, while PROXY Protocol communicates connection identity and metadata.
