You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS Lightsail、Route 53与CloudFront配置连接问题求助

Troubleshooting Your CloudFront + Route53 + Lightsail/Plesk Setup

Hey there, let's break down what's going wrong and fix this step by step. The key issue here is that your CloudFront distribution is pulling the Plesk default domain instead of your actual website, and your DNS change broke access—let's tackle both:

1. First: Don't add a second A record pointing to your static IP

Having both an Alias record to CloudFront and an A record to your instance's IP will cause DNS conflicts (browsers might randomly pick either, leading to inconsistent behavior or full outage). Stick with only the Alias record for your apex domain pointing to CloudFront.

2. Fix the CloudFront Origin (Lightsail Console)

Since you created the CloudFront distribution through Lightsail, this is where the root problem likely lies:

  • Log into your Lightsail console, navigate to your CloudFront distribution.
  • Check the Origin settings: It's probably set to the Plesk default domain instead of your Lightsail instance's static IP (using the IP avoids DNS loops that would happen if you pointed it to your custom domain).
  • Update the Origin to your instance's static IP address, then save the changes.
  • While you're here, verify your Behavior settings:
    • Set the Viewer Protocol Policy to match your site's needs (e.g., "Redirect HTTP to HTTPS" if you're using SSL).
    • Ensure the Default Root Object is set to your site's homepage (like index.html or index.php—this prevents CloudFront from returning a 403 when accessing the apex domain directly).

3. Verify Route53 Alias Configuration

Double-check your apex domain's Alias record:

  • Instead of manually pasting the CloudFront distribution URL, use the dropdown menu in Route53 when selecting "Alias to CloudFront distribution". This ensures you pick the correct, fully qualified CloudFront domain and avoids typos.
  • Confirm the CloudFront distribution you're pointing to has your custom domain listed in its settings (you already said it's "Valid, in use", so this should be good, but it never hurts to double-check).

4. Check Plesk Settings

Make sure your Plesk setup is ready to serve traffic from CloudFront:

  • Test that your site loads correctly when accessing it directly via your instance's static IP (this rules out Plesk configuration issues with your site itself).
  • Ensure Plesk isn't restricting access by IP address—CloudFront uses a range of IPs to fetch content, so you can't whitelist a single IP. If you have IP restrictions enabled, you'll need to remove them or add CloudFront's official IP ranges.

5. Flush Caches and Wait for Propagation

  • Flush your CloudFront cache (you can do this in the Lightsail console under your distribution's settings) to clear any cached Plesk default page content.
  • DNS changes can take 5-15 minutes to propagate globally. Use tools like dig or nslookup in your terminal to confirm your apex domain is resolving to CloudFront's IP addresses (not your instance's static IP).

Once you've worked through these steps, your site should start loading correctly via your apex domain through CloudFront.

内容的提问来源于stack exchange,提问作者Jammer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 07:02:38