Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring Forwarded/X-Forwarded-* headers #134

Commits on Jul 9, 2020

  1. Allow configuring Forwarded/X-Forwarded-* headers

    Implement the ROUTER_SET_FORWARDED_HEADERS environment variable and
    haproxy.router.openshift.io/set-forwarded-headers route annotation.  The
    annotation takes precedence over the environment variable.  The environment
    variable and annotation may specify any of the following values to control
    when HAProxy sets the Forwarded and X-Forwarded-* headers:
    
    * "append" to append to existing headers.
    * "replace" to replace existing headers.
    * "if-none" to set the headers if they are absent.
    * "never" to never set headers.
    
    The default setting is "append".
    
    This commit is related to NE-343.
    
    https://issues.redhat.com/browse/NE-343
    
    * images/router/haproxy/conf/haproxy-config.template: Add a new variable,
    setForwardedHeadersPattern, with a regular expression that matches the
    values listed above.  Add a new variable, setForwardedHeadersAnnotation,
    with the new annotation.  Add a new variable,
    setForwardedHeadersDefaultValue, with value of ROUTER_SET_FORWARDED_HEADERS
    if specified or else the default value "append".  Use these variables to
    control when the Forwarded and X-Forwarded-* headers are set for the
    backend.
    Miciah committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    026122f View commit details
    Browse the repository at this point in the history
  2. Delete stray comment in haproxy-config.template

    Delete the "Add x-forwarded-for header." comment that was added in
    <openshift/origin@d74ebe6>.
    
    * images/router/haproxy/conf/haproxy-config.template: Delete comment.
    Miciah committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    447fe9f View commit details
    Browse the repository at this point in the history