If you using an AWS Lightsail loadbalancer and running a Bitnami instance with an https to https redirect, the chances are that you loadbalancer is failing its health check.

Why??

Well the lightsail loadbalancer does a health check on port 80 and if you doing redirect from 80 to 443, this health check will fail.

How do I fix this?

Create a file specifically for passing this health check in the wordpress documentroot:

$ echo “HTTP health check” >> /opt/bitnami/apps/wordpress/htdocs/health.html

After creating the health check file, you will need to edit the configuration file:

in /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf or /opt/bitnami/apache2/conf/bitnami/bitnami.conf

# Change
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

# To
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/health.html
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

save and quit. :wq!

#Restart apache:

$ sudo /opt/bitnami/ctlscript.sh restart apache

Now you should be able to load the health.html page via HTTP, for example:

https://ip/health.html

# Or even using your domain name

https://url/health.html

Leave a Reply

Your email address will not be published. Required fields are marked *