Keywords: WordPress Multisite - AWS - Technical issue - Secure Connections (SSL/HTTPS)
I have recently built a website on AWS by using a bitnami wordpress multisite instance, in order to speed things up, I have decided to use it with CloudFront and for security, with SSL, I have setup the target group and included the instance as my target, set up the load balancer and added that target group (inlcuding the port 443 listener with the certificate I used on the certificate manager), added the load balaner to the cloudfront, finally, i created a permanent direct (301) from my goDaddy account (where I currently manage the DNS records) to the "Domain Name" of the cloudfront Distribution with HTTPS.
However, right now, whenever I try to connect, the http to https direction is satisfied but i get "502 ERROR The request could not be satisfied." error
here are the details of the set up:
On the bitnami instance, I have set up the main domain with:
sudo ./bnconfig --machine_hostname my_domain.com
sudo mv bnconfig bnconfig.disabled
target group's listener listen's to port 80 and the instance is added as the target (but it seems like unhealthy), stating that "health check failed with this code "
Load balancer, which directs to that target group, has 2 listeners, for port 80 and port 443. the action for the port 443 is "forward to". For 443, I am using the certificate I issued via the certificate manager on AWS, it includes 2 domains with its sub domains (i.e. thisdomain.com, *.thisdomain.com, anotherdomain.com, *.anotherdomain.com), later on, I am planning to add this another domain to this wordpress multisite, that's why added in the same certificate. I can also see the request counts under the "monitor" tab.
Cloudfront distribution has the loadbalancer added, it has "HTTPS only" and "Redirect HTTP to HTTPS" set, "Forwarded query strings" on and already added all the domains I mentioned before as CNAMEs.
Finally, as mentioned before, on Godaddy I have created a permanent direct to the cloudfront, I have added a "www" CNAME record to the same distribution as well.
Another interesting thing is, when I try to connect to directly to the public DNS of the EC2 instance, it still gets directed to the .xip.io address but gives the error "ERR_NAME_NOT_RESOLVED"
If you need more info I will be more than glad to provide.