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

Create route option to force www redirect #1947

Open
seanhamlin opened this issue Jun 11, 2020 · 2 comments
Open

Create route option to force www redirect #1947

seanhamlin opened this issue Jun 11, 2020 · 2 comments
Labels
2-build-deploy Build & Deploy subsystem 6-images-testing Base Images & Testing subsystem lagoon.yml

Comments

@seanhamlin
Copy link
Contributor

The idea here is to allow another .lagoon.yml option to be attached to a given domain, that will force all requests to be immediate HTTP 301 redirects to the same URI but the HTTP host will have www. prepended.

e.g. the .lagoon.yml:

environments:
  master:
    routes:
      - nginx:
        - example.com
            tls-acme: 'true'
            www-redirect: 'true'
        - www.example.com:
            tls-acme: 'true'

Workaround

Currently the best way to do this, is to amend the Nginx image to add in a redirect, this however requires a lot of base knowledge to execute.

@seanhamlin seanhamlin added 6-images-testing Base Images & Testing subsystem 2-build-deploy Build & Deploy subsystem labels Jun 11, 2020
@tobybellwood
Copy link
Member

Also related to #1899 (a more complex implementation, but reusable logic no doubt)

@Schnitzel
Copy link
Contributor

I like the idea of doing redirects directly in the .lagoon.yml file instead of the nginx config, but I think we need to architect this a bit better:

  1. OpenShift does not have any support for this on the ingress controllers (haproxy does not have redirect annotations) so we will need to think about how we solve this when we deploy into an OpenShift cluster. Or mark it for Kubernetes Nginx Ingress only which will be hard to manage again as we should probably tell the developers during a deployment that this is not supported by their cluster?
  2. if we allow non-www to www redirects, how would we solve this other way round?
  3. We have many customers that not only have redirects from and to www but also other domains, like different typos in the domain (example.com and exsample.com) or different top level domains (example.com and example.net). This is technically also a redirect and I think it would be nice to handle this in the same place as many customers could only migrate the www redirects to this new system but not the other redirects they already implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-build-deploy Build & Deploy subsystem 6-images-testing Base Images & Testing subsystem lagoon.yml
Projects
None yet
Development

No branches or pull requests

3 participants