Search code examples
amazon-web-servicesnginxamazon-ec2aws-application-load-balancer

EC2 nginx config and SSL for ALB


I am trying to add an AWS ALB for my EC2 instances. I created Application Load Balancer for two EC2 instances as well as ALB with auto-scaling group but none of these works. The individual EC2 instance is running OK which I tested but the ALB public IP is getting an error page. I wonder if EC2 nginx need to configured differently and whether adding SSL to ALB or to both EC2 instances. I am hosting an react nodejs app on the ECs. Can anyone give me some direction how to troubleshoot and fix this issue? Thanks


Solution

  • I wonder if EC2 nginx need to configured differently and whether adding SSL to ALB or to both EC2 instances

    Usually you add SSL to ALB. There are only few use-cases where SSL on instances would be needed (e.g. strict regulatory reqquirenemnts for end-to-end encryption). So in general case you would have:

    Client --- (HTTPS) ---> ALB ---- (HTTP) ---> Instances