Skip to content

Honor X-Forwarded-Port header - #11391

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
miminar:honor-x-forwarded-port
Dec 14, 2016
Merged

Honor X-Forwarded-Port header#11391
openshift-bot merged 1 commit into
openshift:masterfrom
miminar:honor-x-forwarded-port

Conversation

@miminar

@miminar miminar commented Oct 17, 2016

Copy link
Copy Markdown

If the explicit port is specified using this header, use it in base urls
for redirects.

As documented in article "HTTP Headers and Elastic Load Balancing" of
AWS ELB docs:

The X-Forwarded-Port request header helps you identify the port that
an HTTP or HTTPS load balancer uses to connect to the client.

Resolves #11337

Fixes bz#1383439

@miminar miminar changed the title Honor X-Forwarded-Port header [DO NOT MERGE] Honor X-Forwarded-Port header Oct 17, 2016
@miminar
miminar force-pushed the honor-x-forwarded-port branch from b8913d3 to a9ff442 Compare October 17, 2016 13:19
@miminar

miminar commented Oct 17, 2016

Copy link
Copy Markdown
Author

Let's wait on upstream review of distribution/distribution#2008.

@miminar
miminar force-pushed the honor-x-forwarded-port branch from a9ff442 to c427997 Compare November 8, 2016 09:18
@miminar miminar changed the title [DO NOT MERGE] Honor X-Forwarded-Port header Honor X-Forwarded-Port header Nov 8, 2016
…rded headers

Prefer non-standard headers like X-Forwarded-Proto, X-Forwarded-Host and
X-Forwarded-Port over the standard Forwarded header to maintain
backwards compatibility.

If a port is not specified neither in Host nor in forwarded headers but
it is specified just with X-Forwarded-Port, use its value in base urls
for redirects.

Forwarded header is defined in rfc7239.

X-Forwarded-Port is a non-standard header. Here's a description copied
from "HTTP Headers and Elastic Load Balancing" of AWS ELB docs:

> The X-Forwarded-Port request header helps you identify the port that
> an HTTP or HTTPS load balancer uses to connect to the client.

Signed-off-by: Michal Minář <miminar@redhat.com>
@miminar
miminar force-pushed the honor-x-forwarded-port branch from c427997 to f1eca13 Compare November 8, 2016 09:20
@miminar

miminar commented Nov 8, 2016

Copy link
Copy Markdown
Author

Upstream PR merged.

@liggitt PTAL

@miminar

miminar commented Nov 10, 2016

Copy link
Copy Markdown
Author

/cc @legionus

@mfojtik

mfojtik commented Dec 14, 2016

Copy link
Copy Markdown
Contributor

LGTM (tested manually and confirmed it works as expected).

@mfojtik

mfojtik commented Dec 14, 2016

Copy link
Copy Markdown
Contributor

[merge]

@mfojtik

mfojtik commented Dec 14, 2016

Copy link
Copy Markdown
Contributor

(also fixes: #12260)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to f1eca13

@openshift-bot

openshift-bot commented Dec 14, 2016

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12379/) (Base Commit: 993395c) (Image: devenv-rhel7_5546)

@openshift-bot
openshift-bot merged commit 652b30b into openshift:master Dec 14, 2016
@miminar
miminar deleted the honor-x-forwarded-port branch March 22, 2017 12:16
rlaurika added a commit to CSCfi/pouta-openshift-cluster that referenced this pull request Oct 30, 2017
The registry is by default deployed using a certificate signed by the
OpenShift CA. As this is not generally recognized, create a new
re-encrypting edge route to the registry that uses a proper certificate.
This way it is possible to login to the registry normally.

Using the re-encrypting route triggers a bug in the Docker registry that
is fixed in a newer version. To work around this bug, manually update
the Docker image used for the registry to a newer one. See:
openshift/origin#14249 and also
openshift/origin#11391.

The registry console also needs to be reconfigured with the new route to
the registry. Make this configuration change using the oc_env module
from openshift-ansible. For this to work, add modules from the
lib_openshift role into the library path.

Replace the certificate of the registry console with a proper recognized
certificate so that warnings are not shown when accessing the console
from a browser.

Write tests for checking correct connectivity to the routes used for the
registry and the registry console. These should verify that there are no
certificate issues with the endpoints.
rlaurika added a commit to CSCfi/pouta-openshift-cluster that referenced this pull request Oct 30, 2017
The registry is by default deployed using a certificate signed by the
OpenShift CA. As this is not generally recognized, create a new
re-encrypting edge route to the registry that uses a proper certificate.
This way it is possible to login to the registry normally.

Using the re-encrypting route triggers a bug in the Docker registry that
is fixed in a newer version. To work around this bug, manually update
the Docker image used for the registry to a newer one. See:
openshift/origin#14249 and also
openshift/origin#11391.

The registry console also needs to be reconfigured with the new route to
the registry. Make this configuration change using the oc_env module
from openshift-ansible. For this to work, add modules from the
lib_openshift role into the library path.

Replace the certificate of the registry console with a proper recognized
certificate so that warnings are not shown when accessing the console
from a browser.

Write tests for checking correct connectivity to the routes used for the
registry and the registry console. These should verify that there are no
certificate issues with the endpoints.

Split the registry config changes into their own playbook from the
post-install playbook to keep things tidy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants