Search code examples
amazon-web-serviceshttpportamazon-lightsail

AWS Lightsail Load Balancer: Change default ports from 80/443


So I've setup an AWS Lighsail load balancer and attached it to a single instance.

My instance is running a REST API on port 8080. I'd like to be able to route HTTP (and down track HTTPS) requests hitting the front end of the load balancer to port 8080 on my instance. By default the load balancer routes to port 80 on the attached instance.

I'd also like to change the default ports on the load balancer. The load balancer listens on ports 80 & 443. It says these are 'defaults' in the AWS Lightsail console.

I'm struggling to find any settings related to changing default ports or port forwarding.

Any help would be much appreciated...


Solution

  • Seem it's not possible to change default port of AWS Lightsail Load Balancer. Lightsail instance install Bitnami package which includes Apache httpd service. This httpd service hosts the port 80 by default, and expected to receive traffic from AWS Load Balancer and forwards to your application. Therefore, your application run in Lightsail instance should be configured to be proxied by this httpd service. If you want AWS Load Balancer to direct traffic to your application, not via httpd service, just stop this httpd service and then start your application using port 80.