Skip to content

Commit

Permalink
Set HTTP X-Forward-For option as default in HAProxy config.
Browse files Browse the repository at this point in the history
This change adds the option forwardfor field under
frontend section in haproxy config file for HTTP and
HTTPS protocols. This will make sure that client's IP
is always forwarded to server in request header.

Change-Id: I8bc9bc1e70285e5a4f1b3eba2ceff51d7229d45d
Closes-Bug: #1485782
  • Loading branch information
Varun Lodaya authored and Varun Lodaya committed Aug 17, 2015
1 parent 770c5e9 commit c431384
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vnsw/agent/oper/loadbalancer_haproxy.cc
Expand Up @@ -126,6 +126,12 @@ void LoadbalancerHaproxy::GenerateFrontend(
*out << string(4, ' ')
<< "maxconn " << vip.connection_limit << endl;
}

if (vip.protocol == "HTTP" || vip.protocol == "HTTPS") {
*out << string(4, ' ')
<< "option forwardfor" << endl;
}

*out << endl;
}

Expand Down

0 comments on commit c431384

Please sign in to comment.