haproxytech / haproxy-consul-connect

HaProxy Connector for Consul Connect. Enables Service Mesh with Consul and HaProxy using TLS and Consul Discovery
Apache License 2.0
95 stars 20 forks source link

Add enable_forwardfor option #40

Closed ShimmerGlass closed 4 years ago

ShimmerGlass commented 4 years ago

This adds an option to enable X-Forwarded-For in the downstream backend. This allows for the destination app to know where the request originated from.

Example config :

{
  "service": {
    "name": "socat",
    "port": 8181,
    "connect": {
      "sidecar_service": {
        "proxy": {
          "config": {
            "enable_forwardfor": true
          }
        }
      }
    }
  }
}

In Addition this fixes how the proxy options are read.