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

Honor X-Forwarded-Port header #11391

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

miminar
Copy link

@miminar miminar commented Oct 17, 2016

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
Copy link
Author

miminar commented Oct 17, 2016

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
Copy link
Author

miminar commented Nov 8, 2016

Upstream PR merged.

@liggitt PTAL

@miminar
Copy link
Author

miminar commented Nov 10, 2016

/cc @legionus

@mfojtik
Copy link
Contributor

mfojtik commented Dec 14, 2016

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

@mfojtik
Copy link
Contributor

mfojtik commented Dec 14, 2016

[merge]

@mfojtik
Copy link
Contributor

mfojtik commented Dec 14, 2016

(also fixes: #12260)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to f1eca13

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 14, 2016

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