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...
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.
Related
I have a Vert.x server running on a single-instance Elastic Beanstalk server, and I'm trying to configure it to operate over HTTPS. I've set up the NS records and A record in AWS Route 53 to map the subdomain to my instance (pinging the subdomain succeeds), requested (and verified) the certificate from ACM, and opened up port 443 in my EC2 security group. But I can't quite figure out how to "attach" the certificate to my domain (if that's somehow necessary) or to get port 443 properly mapped to my Vert.x server.
Any tips will be appreciated.
to get port 443 properly mapped to my Vert.x server.
If you use ACM for the SSL certificate, you have to setup application load balancer. The process is detailed in:
How can I configure HTTPS for my Elastic Beanstalk environment?
To enable load balancer for your EB environment, you have to change EB environment type to Load-balanced if you already don't have that.
With the load balancer, you don't have to modify your application at all, as HTTPS will be fully handled by the load balancer.
I have service running in one of my VM port 8088, I want all traffic to be send to this port via my HTTP LOAD BALANCER
Load-Balancer-IP:8088 -> Redirect to my VM port 8088
Load-Balancer-IP-> Redirect to my VM port 8088
How to configure this in gcp load balancer setting currently my configuration look like this
To forward a custom port to your backend, you need to use a tcp load balancer in single region only.
Keep in mind that is not a proxy but a port forwarding and SSL certificate aren't managed on the load balancer. If you want to use one, you have to host and manage it on your VM.
I have two ec2 instances and deployed java apps to '/var/www/html'.
They are running in port 9010 and I can access them by 'http://xxxx:9010'.
Next,I created elb and added the two instances to it.However,I can't access the java app by elb public dns 'http:elbxxxxx:9010'. It returned 404.
I put index.html to '/var/www/html/' , I can see index.html by elb public dns.
I'm looking for some configurations for ports in elb console but I can't.
How can I access them?
You have to configure a listener on the Elastic Load Balancer. Your listener can be configured to listen on any port (such as 80) and send the requests to your instances on port 9010. Here's how to configure listeners.
i am having issues setting up an EC2 load balancer, on a instance, that has multiple domains protected by SSL.
Is it possible to make the load balancer pass the HTTPS request as is, and get it decrypted at the server level? If so, how do i set that up?
I have a standard LAMP setup on a EC2.
On your Elastic Load Balancer, configure a TCP listener that listens on port 443 and forwards to port 443 on the instances. This will allow your EC2 instances to perform the SSL termination.
Note that you won't be able to use Sticky Sessions in this configuration.
I can browse to the web site with http but cannot with https, I get ERR_CONNECTION_REFUSED in Chrome.
My environment is an expressJS server on nodejs (64bit Amazon Linux 2015.09 v2.0) running on Elastic Beanstalk. I can telnet to the EC2 elastic public IP on port 80 but I cannot telnet on port 443, connection refused.
Steps taken to set up HTTPS
I created an SSL cert via the AWS Certificate Manager and added the cert to the Load Balancer Listeners.
Port Configuration:
80 (HTTP) forwarding to 80 (HTTP)
Stickiness: Disabled(Edit)
443 (HTTPS, ACM Certificate: 1E21...) forwarding to 80 (HTTP)
Stickiness: Disabled
In the Load Balancer Security Group, I added inbound and outbound https traffic on port 443 Source 0.0.0.0/0.
In my EC2 Elastic I.P, I selected my ExpressJS server instance and then added inbound and outbound https traffic on port 443 Source 0.0.0.0/0.
In addition, I also added the Load Balancer Security Group to my ExpressJS server security because I read in another post that you had to associate the load balancer group with the server instance (not sure that this is required).
Any suggestions?
btw, does HTTPS traffic terminate at the Load Balancer and then unencrypted and handled internally on port 80 to the server?
Solved it, turned out the mistake I made was that I added a record on my monster DNS for my AWS site and pointed it to the AWS Public Elastic IP as a A record, instead, I should have added the CNAME of my Load Balancer to the Monster DNS, once I did that, HTTPS was working.
I also ditched the Public Elastic IP as it was not required anymore, also, having the public I.P prevented me from taking advantage of the load balancer. Hope this helps other people.