0

I have a MERN application with the frontend hosted on Netlify. I currently have the backend hosted at onrender.com. However this is quite slow and so was looking for something with faster load rates.

I have set up an EC2 instance on AWS and it is much faster, but I am struggling to enable HTTPS traffic.

The current setup:

  • EC2 instance set up and backend running. (I have ran it locally over http and it works fine).
  • AWS: security groups enabled https

The issue is that when I try to connect over https, it does not work.

I have tried various things including the ACM certificates (I have a certificate for my domain), creating load balancers that would direct to my instance, but I don't seem to succeeding. Admittedly, I don't fully understand what exactly I need to do here.

The outcome I want is to simply interact with the backend, which is on an AWS ubuntu instance, from my frontend over https.

Any help would be greatly appreciated.

conorkelly
  • 11
  • 1

1 Answers1

0

if you are going the Load Balancer way, should be fairly simple.

  1. Yes, it is a good idea to use ACM to provision Certificate for you.
  2. Make sure that the Security Groups are well configured
  • In your case the Load Balancer should accept traffic from port 80 and 443
  • The Instance security group should be open where you have configured the instance to listen, it depends on your impmenetation
  • In the target group make sure that you have configured the target port correctly (that is the ec2 open port, where recieves traffic), also make sure that the health check is configured correctly.

I attached a quick summary how this little architecture should look like

enter image description here

Sándor Bakos
  • 485
  • 6
  • 10
  • Thank you for the reply! I have tried this and followed it in as much as I think was the right way, but I am still missing something. – conorkelly Jan 30 '23 at 20:13