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

Subdomain redirector #14

Open
joonas-fi opened this issue Feb 16, 2021 · 0 comments
Open

Subdomain redirector #14

joonas-fi opened this issue Feb 16, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@joonas-fi
Copy link
Member

Now we have:

{
  "id": "example.net",
  "frontends": [
    {
      "kind": "hostname",
      "hostname": "example.net",
      "path_prefix": "/"
    }
  ],
  "backend": "..."
}

We want to be able to redirect www. => naked domain. Options:

  • Without writing any code, we already have a redirect backend, but our design assumes one backend per app, so we'd have to write separate app for the redirect. => not good
  • Support multiple backends per app (override with redirect backend on www. hostname). This is the only use case that requires it => not good
  • Just have a flag on the frontend that it should redirect to naked domain, and have Edgerouter handle that internally somehow. That feels a bit dirty though, too.

The last idea looks something like:

{
  "id": "example.net",
  "frontends": [
    {
      "kind": "hostname",
      "hostname": "example.net",
      "path_prefix": "/"
    },
    {
      "kind": "hostname",
      "hostname": "www.example.net",
      "path_prefix": "/",
      "redirect_to_naked_domain": true
    }
  ],
  "backend": "..."
}

Currently we're using Cloudflare page rules for this, but I don't like it because I like the idea of turning Cloudflare off and not having behavioural changes

@joonas-fi joonas-fi added the enhancement New feature or request label Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant