Website crashed after setting up Load balancer Error- Too many redirects

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)
My website is on EC2 - t2 micro instance

After configuring a Load balancer for my website on EC2, website is not loading and getting the error: TOO MANY REDIRECTS
I followed this documentation;

I did setup the load balancer successfully and modified the Server configuration as advised. (Followed all steps in the documentation)

I found the same issue mentioned in forums several times. The solution they had given was, including this code on wp-config.php file:

if (strpos($SERVER[‘HTTPX_FORWARDED_PROTO’], ‘https’) !== false)

But I have already added this code and rechecked it several times.

What I have already done based on Bitnami documentation (regarding configuring the server) are as follows:

  1. updating the Apache server configuration on the Bitnami application instance to correctly handle SSL requests from the load balancer.

‘SetEnvIf x-forwarded-proto https HTTPS=on’

  1. manually editing the wp-config.php file
    if (strpos($_SERVER[‘HTTP_X_FORWARDED_PROTO’], ‘https’) !== false) $_SERVER[‘HTTPS’]=‘on’;

  2. Force HTTPS: Redirect all traffic to HTTPS by adding the following to /opt/bitnami/apache2/conf/bitnami/bitnami.conf

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}

I restarted the apache again and these lines appear:

Unmonitored apache
Syntax OK
/opt/bitnami/apache2/scripts/ : httpd stopped
Syntax OK
/opt/bitnami/apache2/scripts/ : httpd started at port 80
Monitored apache

Looking forward to hearing from you @bitnamisupport

Hi @erandaind93,

Thanks for using Bitnami. We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

I sent a private message to you including a google drive link. Containing the zip file generated by support tool.

can you please confirm that you have received the message

thank you

Hi @erandaind93,

Thanks for your message. However, we found you have another thread for the same question. We will close this thread and continue working with you in the other thread