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

Lightsail Distribution problem 502 The request could not be satisfied.

0

This problem is not clodfront problem this is lightsail distirubution problem.

i have this problem Distribution

502 ERROR The request could not be satisfied. CloudFront wasn't able to connect to the origin. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Generated by cloudfront (CloudFront) Request ID: Vio5PfacxQFjHo4E1K59pFb36feKbqtirbIOEoY5mYhlVF65gvTlKg==

https://d20dxgmq3z6jfk.cloudfront.net/

if Origin protocol policy http only other problem to many redirects my website working right now https://odakmermer.com

just problem cloudfround subdomain.

how to fix it ?

!!!!İMPORTANT!!!!

If I change the WordPress cache type in Lightsail distribution, for example, to static or dynamic, my site gives a 502 error.

my wp-config.php add this code but stil problem

define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');

if ( isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']) && $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https' ) { $_SERVER['HTTPS'] = 'on'; }

10 Answers
0

My settings here

Enter image description here

Enter image description here

Enter image description here

Enter image description here

Enter image description here

Enter image description here

answered 5 months ago
0

my wordpress version 6.5.5 define('WP_SITEURL', 'http://DOMAIN/'); define('WP_HOME', 'http://DOMAIN/'); if (isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']) && $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; }

my website database url https://sitename.com

https://sitename.com

or

http://sitename.com ? Which one will I use?

stil not working this url

https://d20dxgmq3z6jfk.cloudfront.net/

502 error

answered 5 months ago
  • Try http://sitename.com please i.e. only HTTP ( no S )

0

Seems that your website working well I see, your website (https://odakmermer.com) is using CloudFront CDN.

And I cannot get your mean that you ask.

profile picture
answered 5 months ago
0

I'm using cache on the Lightsail distribution screen for WordPress.

When I set the cache mode to dynamic, everything works fine, but when I set it to static, I get a 502 error.

And this address always has a 502 error; you can see it if you visit the address. This is the distribution URL:

https://d20dxgmq3z6jfk.cloudfront.net/

answered 5 months ago
0

Hi,

If you are using a WordPress version 3.3.1-5 or higher, the wp-config.php needs to have following lines:

define('WP_SITEURL', 'http://DOMAIN/');
define('WP_HOME', 'http://DOMAIN/');
if (isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'])
&& $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}

You may have copied the settings for a previous version of Wordpress. For more details check step 7 in this document: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-editing-wp-config-for-distribution.html#configuring-non-https-wordpress-for-distribution.

You can check the WordPress version in your terminal by executing sudo wp core version

Thanks.

AWS
answered 5 months ago
0

Point a domain to your Lightsail distribution (https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-point-domain-to-distribution.html)

My domain which using CloudFront distribution: status.microcharon.dev --CNAME-- d1h0kqcdy7oarf.cloudfront.net

Noticed that a CNAME cannot be placed at the root domain level

profile picture
answered 5 months ago
0

Enter image description here define('WP_SITEURL', 'http://odakmermer.com/'); define('WP_HOME', 'http://odakmermer.com/'); if ( isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']) && $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https' ) { $_SERVER['HTTPS'] = 'on'; }

wp-config.php my settings

answered 5 months ago
0

I transferred the database and WordPress wp-content from a different server. Could there be any issues with this? What kind of problems might arise?

answered 5 months ago
0

Hello, my issue is still unresolved. The static mode in WordPress is not working. How can I fix it?

answered 5 months ago
0

Hi,

To address the issues and fix your setup please follow these steps:

  • Disable HTTP to HTTPS redirect in your instance by executing these commands in your WordPress Instance terminal:
sudo cp /opt/bitnami/lightsail/wp-config.php.backup /opt/bitnami/wordpress/wp-config.php
sudo cp /opt/bitnami/lightsail/wordpress-vhost.conf.backup /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf
sudo /opt/bitnami/ctlscript.sh restart
  • Set the origin protocol policy of your lightsail distribution to HTTP only

Thanks.

AWS
answered 5 months 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.

Guidelines for Answering Questions