By using AWS re:Post, you agree to the Terms of Use

New traffic from Ireland

0

Hi there,

I'm hosting a static webpage with CloudFront (CF) and S3 on eu-central-1. Recently, I've set the S3 bucket to redirect to a https domain, which is also a CF/S3 on the same account. Now, new traffic from eu-west-1 is getting billed, and I don't know where this comes from. I thought the S3 would just send a 301 to CF, which would send it to the browser, and then the browser opens a new connection to the 301 target.

What I suspect is that the "redirection component" is something that's only available in eu-west-1, which makes it cross region traffic, but I can be totally wrong. Can someone enlighten me?

Thanks, Ingmar

1 Answer
0

IF you just want to redirect the HTTP url to HTTPS url, then you could just configure it inside CloudFront. Under the Behaviours tab you can set the** Viewer Protocol Policy** to Redirect HTTP to HTTPS. More details available here.

Depending how you have done the 301 on S3 bucket, it might be returning the S3 bucket URL instead of the CloudFront URL. You can also prevent direct access to the S3 bucket by using the Origin Access Control. With this setup only your CloudFront can fetch files from S3 and Public access to S3 bucket is denied. You can read more about creating new origin access control here. (This setup still allows you to use AWS CLI and S3 API to manipulate objects inside the bucket)

If you have any concerns about the billing, please open customer support case. You are able to open Account and billing -cases even with basic support.

profile picture
EXPERT
answered 7 days ago
  • Hi, it's not a case of http>https, but a completely different url, which is however also a cf/s3 setup in the same aws org. This is how I did it: https://i.imgur.com/ClgOyFt.png

  • Thanks for clarification Ingmar. So you using the S3 to move all requests from one domain behind the S3+Cloudfront to completely new domain (CF/S3 combo)? Then that S3 bucket approach is right one to do. CloudFront should cache the 301 according to your settings. Can you see what exactly is been billed for you? Did it start same time as you made that change? You should be able to see this in Cost Explorer. I would suggest that you also check with the Account and billing if you are seeing unexpected costs.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions