octavia/releasenotes/notes/add-x-forwarded-proto-19a1d971cf43b795.yaml
Rafal Pietrzak d3f0a50014 Adding support for the octavia listener X-Forwarded-Proto header insertion.
Adding support for the octavia listener X-Forwarded-Proto header insertion.
  A X-Forwarded-Proto header is inserted into the end of request to the backend
  member. HTTP for the HTTP listener protocol type, HTTPS for
  the TERMINATED_HTTPS listener protocol type.

  Adding X-Forwarded-Proto to the list of HTTP headers which are supported.

  File: octavia/master/octavia/octavia/common/constants.py:
      SUPPORTED_HTTP_HEADERS = ['X-Forwarded-For',
                                'X-Forwarded-Port',
                                'X-Forwarded-Proto']

  Adding the lines to the macros.j2 realizing the the http/https insertion
  to the backend member according to listener protocol type:

  File:  octavia/common/jinja/haproxy/templates/macros.j2

    {% if listener.insert_headers.get('X-Forwarded-Proto',
                                          'False').lower() == 'true' %}
        {% if listener.protocol.lower() == constants.PROTOCOL_HTTP.lower() %}
    http-request set-header X-Forwarded-Proto http
        {% elif listener.protocol.lower() ==
                               constants.PROTOCOL_TERMINATED_HTTPS.lower() %}
    http-request set-header X-Forwarded-Proto https
        {% endif %}
    {% endif %}

Change-Id: Id017bb277eebae98f0441663e41d07b40b6e3e38
Story: 2002173
Task: 20038
2018-06-19 09:55:36 +02:00

5 lines
92 B
YAML

---
features:
- |
Adding support for the listener X-Forwarded-Proto header insertion.