Add www domain redirect support - #404
Open
brainstemu wants to merge 1 commit into
Open
Conversation
|
Thank you for the pull request. ROADMAP STATUS: This pull request isn't currently on any roadmap. Updates will be conveyed here as its place on/off a roadmap changes. You can view the roadmaps here: Roadmaps Google Drive folder. For more information on how the roadmaps work, see our roadmaps policy on GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Adds support for redirecting
www.$HUB_DOMAINto$HUB_DOMAINin the HCCE Kubernetes deployment template.The change also updates the SSL script so the
wwwhostname is included in certificate handling.The redirect uses the existing
$HUB_DOMAINand$Namespacetemplate variables rather than deployment-specific values.Why?
HCCE deployments may be accessed through both the root domain and the
wwwsubdomain.Previously, the
wwwhostname was not handled by the deployment template, which could result in users reaching an unavailable host or receiving a certificate/ingress error.This change provides a consistent canonical domain by redirecting
www.$HUB_DOMAINto$HUB_DOMAIN.The redirect preserves the original path and query string, which is important for Hubs room and content URLs.
Examples
Before:
https://www.example.com/test-room?foo=barmay not resolve correctly through the HCCE ingress.
After:
https://www.example.com/test-room?foo=barreturns a
301redirect to:https://example.com/test-room?foo=barHow to test
Set the normal HCCE environment variables, including
HUB_DOMAINandNamespace.Generate the HCCE Kubernetes configuration using the existing generation process.
Apply the generated HCCE configuration to a Kubernetes cluster.
Confirm the new ingress exists:
kubectl get ingress www-redirect -n "$Namespace"Confirm the redirect from the www hostname:
curl -I "https://www.$HUB_DOMAIN/"
Documentation of functionality
The functionality is contained in the HCCE deployment template and SSL script changes included in this pull request.
No separate documentation changes are required.
Limitations
The redirect assumes that DNS for www.$HUB_DOMAIN points to the HCCE deployment and that a valid certificate can be issued for the www hostname.
Alternative implementations considered
A fixed redirect location rule was considered, but that would redirect every request to the root URL and drop the original path.
Using HAProxy's redirect prefix behavior allows the original path and query string to be preserved.
Additional details or related context
The implementation uses the existing HCCE template variables and does not introduce deployment-specific domains or credentials.