Configuring static website with S3 bucket, Route 53 (and SSL certificate) does not work

0

Hello!

I have created a static website and basically followed and configured all instructions linked in this article. However, when I try to open the custom domains, I receive following errors:

  1. for recruiteroo.de: 404 not found / nginx
  2. For www.recruiteroo.de: DNS_PROBE_FINISHED_NXDOMAIN / The website is not reachable

I can't find any setting that would diverge from what has been suggested in the article.

Does someone have any idea on what could go wrong?

Side note: I transferred the above domains from another domain provider to Route53 successfully, if that is of relevance.

I did, too, configure a SSL certificate through AWS Certificate Manager, but don't think that this would have an effect.

已提問 8 個月前檢視次數 381 次
2 個答案
3
已接受的答案

Hi Recruiteroo,

The error messages you provided indicate both a DNS and a possible web server configuration issue.

Lets check some items:

  • Make sure the bucket has been set up for static website hosting and note the provided endpoint.
  • Ensure you have an index document (e.g., index.html) in the bucket.
  • For recruiteroo.de, ensure there's an A record in Route 53 with Alias set to the S3 website endpoint.
  • The "404 not found / nginx" error indicates there might be a lingering server configuration associated with the domain or there's a misconfiguration at the DNS or CDN level.
  • If you previously had a web server (like nginx) associated with this domain, ensure you've updated all DNS records to point to AWS services (S3/CloudFront) instead of the old server.
  • Use tools like nslookup or dig to check DNS resolution for your domains.

When setting up a static website on S3, the bucket's content needs to be publicly accessible so that users can view the site. However, there are a few different approaches:

  • Bucket Policy for Public Access: Traditionally, a bucket policy was set to grant public read access. This is effective and allows anyone to view the bucket's content.
  • Using Amazon CloudFront (recommendation): For added performance and security, you can distribute your S3-hosted website with Amazon CloudFront. By using CloudFront, you benefit from faster content delivery via a Content Delivery Network (CDN), as well as the ability to use an SSL/TLS certificate for your custom domain.

I hope this helps! If this solution works for you, please accept the answer. Otherwise, do leave a comment, and I'll try to assist you.

profile picture
已回答 8 個月前
profile picture
專家
已審閱 6 天前
profile pictureAWS
專家
已審閱 8 個月前
  • Thank you for the hints and quick reaction! In fact, it was an old AAAA record that pointed to the former hosting provider. I deleted the record, and it worked!

    Question: How would I be able to create a new AAAA record, where would I get the value for the IPv6 address from?

1

If you want to also use an SSL Certificate, you should rather serve your static website with CloudFront. In this case you can use any S3 bucket as the origin, and configure an origin access identity in CloudFront to connect to S3.

There is a pretty comprehensive answer here by AWS Support on the details of using this approach: https://repost.aws/knowledge-center/cloudfront-serve-static-website

AWS
專家
已回答 8 個月前
profile picture
專家
已審閱 1 個月前
  • Thank you for the hint with CloudFront and the link - this will definitely be the next step, while the solution to the initial problem was provided by another user.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南