Skip to content

Sync X-Forwarded-Proto and Forwarded header when possible #296

@systemfreund

Description

@systemfreund

Situation:

  • AWS loadbalancer is configured to terminate TLS at the loadbalancer level
  • LB hands requests over to Fabio via http
  • When a https-request is made AWS LB sets following headers before calling fabio:
    • X-Forwarded-For: x.x.x.x
    • X-Forwarded-Proto: https
  • Fabio does not override the headers above, however it sets the following before passing the request to upstream:
    • Forwarded: for=x.x.x.x; proto=http; by=y.y.y.y

Now my application wrongly assumes that the "real" request is made via http and not https, because it consumes the Forwarded if its present, instead of X-Forwarded-For|Proto.

I am not sure if it's a problem in my application, or in fabio, as there's a discrepancy in both headers:

  • X-Forwarded-Proto says it's https
  • Forwarded says it's proto=http

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions