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

Redirect www to main domain #51

Open
magul opened this issue Apr 2, 2020 · 3 comments
Open

Redirect www to main domain #51

magul opened this issue Apr 2, 2020 · 3 comments

Comments

@magul
Copy link
Member

magul commented Apr 2, 2020

Make that default behavior of CloudFront distribution.

See: https://aws.amazon.com/premiumsupport/knowledge-center/redirect-domain-route-53/ (plus another CloudFront distro in front to handle possible HTTPS traffic).

@arturtamborski
Copy link
Member

Can you explain in little bit more detail what exactly do you want to achieve here?

Redirect www to main domain

Does this rule apply to every domain that we have?

Also, there seems to be some kind of misconfiguration in OVH i think for pah-fm?
I can access http://www.dev.pahfm.codeforpoznan.pl but that shouldn't be possible judging by the TF configuration.

So maybe www.codeforpoznan.pl -> codeforpoznan.pl is enough?


CloudFront distro in front to handle possible HTTPS traffic

I'm pretty sure that all domains described in this repo are SSL-only. I've checked it quickly with few links and all of them redirect me to https.

@magul
Copy link
Member Author

magul commented Jul 1, 2020

To clarify - these are two different things:

  • redirect HTTP to HTTPs
  • redirect www to the main domain.

I'm certain that we handle the first one in all our CloudFront distributions (see: https://github.com/CodeForPoznan/Infrastructure/blob/master/cloudfront_distribution/main.tf#L64 and https://github.com/CodeForPoznan/Infrastructure/blob/master/cloudfront_distribution/main.tf#L85) so

I'm pretty sure that all domains described in this repo are SSL-only

that's not true.

The second thing (www redirect) - I don't believe we have to redirect for all domains (or CloudFront distributions), but I believe we should enable such solution for critical one. I would prefer to have it set using parameter passed to cloudfront_distribution module (maybe redirect-from-www?) which will be set by default to false. If it will be set to true beside normal CloudFront distribution we will create:

  • dedicated S3 bucket responsible for redirect
  • CloudFront in front of that that will serve this one file
  • www domain that will point to CloudFront distribution and necessary SSL key to handle HTTPs there.

@magul
Copy link
Member Author

magul commented Jul 1, 2020

Also, there seems to be some kind of misconfiguration in OVH i think for pah-fm?

Also I don't know what do you mean here as this domain is served from AWS Route 53 zone.

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

No branches or pull requests

2 participants