Setting Up LoadBalancer on AWS Lightsail for WordPress Multisite

Keywords: WordPress Multisite - AWS - How to - Secure Connections (SSL/HTTPS)

Description:
I just created a multisite instance on AWS Lightsail. I’ve attached a Loadbalancer with a certificate to it. However, since the Bitnami file configuration has changed since last year when I created a previous setup similar to this one; I’m finding it hard to setup the ssl configuration. For example, previously I would find this:

SetEnvIf x-forwarded-proto https HTTPS=on

DocumentRoot “/opt/bitnami/apps/wordpress/htdocs”
#Alias /wordpress/ “/opt/bitnami/apps/wordpress/htdocs/”
#Alias /wordpress “/opt/bitnami/apps/wordpress/htdocs”

RewriteEngine On
RewriteCond “%{HTTP_HOST}” ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})….amazonaws.com(:[0-9])?$
RewriteRule “^/?(.*)” “%{REQUEST_SCHEME}://%1.%2.%3.%4%5/$1” [L,R=302,NE]

Include “/opt/bitnami/apps/wordpress/conf/httpd-app.conf”

In the httpd-prefix.conf file. My new instance doesn’t have that file. Can you tell me how to configure the files properly to get the load balancer to work or point me to documentation that is up to date concerning this? Right now, I’m getting a health test fails even though I’ve created a test.txt file for it to test. Here is my support code if you need it: 1693ba3e-f03d-3c92-a5e1-42988906001d

Hello @amjwebservices2,

You will need to use vhosts in our new structure. You can check our guide on Varnish configuration and use it as a reference to configure your apache configuration file and any created vhost:

https://docs.bitnami.com/general/apps/wordpress/administration/configure-use-varnish/#use-varnishtm-with-ssl

Regards,
Francisco de Paz

I’ve implemented the steps to configure Varnish and my load balancer is still failing the health checks. Please advise what to do now. Here is my code from the Bitnami Support Tool: a8a4bd1d-6fb1-ea88-f4fa-ad3bb5975ae2

I was able to find a solution to my problem and was able to get the load balancer to pass it’s health check. I decided to change this line RewriteCond %{HTTP_HOST} ^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})(:[0-9]{1,5})?$ that is in both the wordpress-https-vhost.conf and the wordpress-vhost.conf files to RewriteCond %{HTTP_HOST} ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})….amazonaws.com(:[0-9])?$ I hope this help those who has ran into this problem. Thank you for your response and help.

Thank you for posting the solution here. I’ll notify our documentation team to add a note in the guide to help other users in the future :slight_smile:

Have a good day!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

We have updated the guide at https://docs.bitnami.com/aws/how-to/configure-elb-ssl-aws/ with this information.