Skip to content

Lightsail content delivery network Tutorials not working

0

Good day Would you please assist? I have tried both of these tutorials but neither work. Tutorial 1: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-wordpress-for-distribution.html With Tutorial 1 the website content vanishes and only "domain" shows in the url bar.

Tutorial 2: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-wordpress-for-distribution-bitnami.html With Tutorial 2 the site briefly shows and then vanishes and shows Gateway 503. After using: define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/'); if (isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']) && $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; }

6 Answers
1

Hi,

The tutorial for configuring WordPress with a Lightsail content delivery network has been updated. Please refer to the doc here: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-wordpress-for-distribution.html

AWS
MODERATOR

answered 16 days ago

AWS
EXPERT

reviewed 14 days ago

  • Thank you. It works.

0

Thank you. The site seems to still have issues as when I use some pages it goes blank and mixes content. See the screenshots. Enter image description here Enter image description here Enter image description here

answered 25 days ago

0

This seems to be the solution: (Which is not in the tutorial)

However, if you're using a newer version (3.3.1-5 or higher), you need to specify your actual domain in the WP_SITEURL and WP_HOME definitions rather than using the dynamic $_SERVER['HTTP_HOST'] variable.

answered a month ago

EXPERT

reviewed a month ago

0

There is still an issue with the website as it loads very slowly and gets a lot of errors when loading new pages. See site at: https://kliek.co

answered a month ago

EXPERT

reviewed a month ago

0

Hi,

Thanks for reaching out!

www.kliek.co currently has a CNAME record pointing to your distribution. However, kliek.co (your apex domain) has no record pointing to your distribution, so it doesn't resolve. The reason for this difference is that DNS doesn't allow CNAME records at the zone apex—apex and subdomain domains require different record types.

To fix this, please:

  1. Go to Domains & DNS → your DNS zone → DNS records → Add record
  2. Add an A record for kliek.co (your apex domain)
  3. Set Resolves to your distribution
  4. Leave the existing CNAME for www.kliek.co as-is. It's already correct

After you save, please allow a few minutes for DNS to propagate. Once it does, kliek.co will load just like www.kliek.co does.

For additional details, you can reference: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-point-domain-to-distribution.html

AWS
MODERATOR

answered a month ago

-1

I understand you're experiencing issues with configuring your WordPress instance to work with a Lightsail content delivery network distribution. Let me help troubleshoot these problems.

For the first issue where the website content vanishes and only 'domain' shows in the URL bar, this typically indicates that the WP_SITEURL and WP_HOME values in your wp-config.php file need to be set correctly. When using WordPress version 3.3.1-5 or higher, you should replace 'DOMAIN' in the configuration with your actual domain name. The code should look like: define('WP_SITEURL', 'http://yourdomain.com/'); and define('WP_HOME', 'http://yourdomain.com/'); - making sure to use your actual domain instead of the placeholder text.

For the 503 Gateway error you're seeing with the second tutorial, this often occurs when there's a mismatch between your distribution's origin protocol policy and your WordPress instance configuration. Here are some key things to verify:

  1. Ensure your WordPress instance is running and accessible before testing the distribution
  2. Check whether your WordPress site uses HTTP or HTTPS as the origin - this determines how your distribution should be configured
  3. If your website uses HTTP only, configure your distribution to terminate SSL/TLS and forward requests using an unencrypted connection
  4. If your website uses HTTPS, configure your distribution for end-to-end encryption
  5. Verify that you've restarted the Apache service after making changes to the wp-config.php file

The code you're using appears correct for WordPress version 3.3 or lower. However, if you're using a newer version (3.3.1-5 or higher), you need to specify your actual domain in the WP_SITEURL and WP_HOME definitions rather than using the dynamic $_SERVER['HTTP_HOST'] variable.

I'd recommend double-checking which WordPress version you're running and ensuring you're using the appropriate code snippet for that version, with your actual domain properly specified where needed.
Sources
Configure WordPress with a Lightsail content delivery network - Amazon Lightsail
Configure WordPress with a Lightsail content delivery network - Amazon Lightsail

answered a month ago

EXPERT

reviewed a month ago

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.