Configuring Proxy Protocol for Your Load Balancers

The proxy protocol is a transport protocol used to transfer connection information from a client through intermediaries. When enabled, the header containing the connection information remains the same from the client to the destination, it is not replaced with proxy information.

Combining a proxy server with the Proxy Protocol could result in errors depending on your configuration.

To enable proxy protocol for your load balancers, you need to create one or more policies.

Enabling or Disabling Proxy Protocol Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

Enabling Proxy Protocol

Before you begin: Make sure your instances and listeners can process proxy protocol information.

  1. To create a proxy protocol policy for your load balancer, use the create-load-balancer-policy command following this syntax:

    Request sample
    $ aws elb create-load-balancer-policy \
        --profile YOUR_PROFILE \
        --load-balancer-name LOAD_BALANCER_NAME \
        --policy-name POLICY_NAME \
        --policy-type-name ProxyProtocolPolicyType \
        --endpoint https://lbu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

    • load-balancer-name: The name of the load balancer whose attributes you want to modify.

    • policy-name: The name of the load balancer policy to create. This name must be unique within the policies of the specified load balancer.

    • policy-type-name: The name of the base policy type.

      Only ProxyProtocolPolicyType is supported.

    • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

  2. To enable a proxy protocol policy for your load balancer, use the set-load-balancer-policies-for-backend-server command following this syntax:

    Request sample
    $ aws elb set-load-balancer-policies-for-backend-server \
        --profile YOUR_PROFILE \
        --instance-port 80 \
        --load-balancer-name LOAD_BALANCER_NAME \
        --policy-names POLICY_NAME_1 POLICY_NAME_2 \
        --endpoint https://lbu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

    • instance-port: The port on which the backend instance is listening.

    • load-balancer-name: The name of the load balancer.

    • policy-names: The names of all the policies you want to enable for your load balancer.

      You need to list the already enabled policies that you want to keep along with the new ones you are enabling. If the list is empty, then all current policies are removed from the load balancer.

    • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

To verify that the Proxy Protocol policy is enabled, see Getting Information About Your Load Balancers.

Disabling Proxy Protocol

To disable a proxy protocol policy for your load balancer, use the set-load-balancer-policies-for-backend-server command following this syntax:

Request sample
$ aws elb set-load-balancer-policies-for-backend-server \
    --profile YOUR_PROFILE \
    --load-balancer-name LOAD_BALANCER_NAME \
    --instance-port 80 \
    --policy-names "[]" \
    --endpoint https://lbu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • load-balancer-name: The name of the load balancer.

  • instance-port: The port on which the backend instance is listening.

  • policy-names: "[]" to remove all policies from the load balancer.

    Configuring policy-names to "[]" will disable all policies. If you want to disable only some of the defined policies, write the names of the policies you want to remain enabled.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

To verify that the Proxy Protocol policy is disabled, see Getting Information About Your Load Balancers.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.