EC2 Nginx - Application Load Balancer - nginx

I'm creating a new ec2 instance where I installed and setup nginx with ssl certificate, here I'm able to connect to the app using the ip of the instance. Now I want to create a load balancer for that app, I setup the load balancer and issue the certificate for the LB but when I try to connect using the url I get a error 504 from the dns> I'm pretty new using ec2 and LB, is the nginx config creating the problem or what is causing the problem?

Related

Ec2 nginx routing and setup

I have a react app(port 8080) and a backend node app(port 3001) running on an aws ec2 instance, I have nginx routing port 80 from the load balancer to the port 8080 on local host in nginx, but, my front end cannot connect to the backend with axios(localhost:3001).
I have an instance of node for the front end and back end in the folders client and server respectively.
I've tried connecting with http and https, adding a direct 3001 listener all the way up to the domain/balancer and replacing all the paths to the domain(didn't work and also insecure if it did), I also tried without nginx.

Handling CONNECT request with Nginx Ingress on GCP GKE

I have a cluster of proxy servers on GKE, and I'm trying to figure out how to load balance CONNECT requests to these.
Without GKE, I'm using the nginx stream module (http://nginx.org/en/docs/stream/ngx_stream_core_module.html) which works perfectly.
GCP load balancers do not accept CONNECT requests, so I'm trying to take my existing nginx configuration file and apply it to an nginx ingress resource for GKE. Is this possible?

GoDaddy domain in AWS with SSL for Wordpress application Issue

Currently, I am working on a Wordpress application and I am using AWS hosting. My domain is in GoDaddy.com and I have deployed the application in elastic beanstalk. I have created load balancer and also I need to run the application through HTTPS.
I have done my research and I think I found the right way, but it's not working for HTTPS. when I browse on HTTP on port 80, it runs well. Now I am helpless.
Here's what I have done so far:
1) I created a hosted zone on AWS Route 53 for the domain named "example.com". There are two records are created, NS and SOA.
2) Then, in GoDaddy, I added NS records from AWS as Custom Nameservers.
3) After that, I created A record for the domain in the AWS hosted zone, set ALIAS targeted to the Load Balancer of the Elastic Beanstalk environment.
4) Then, I changed the SITE URL from the wp_options table the wordpress application database.
After doing up to this, my application was running in HTTP. But as I want to change it to HTTPS. So,
1) I requested a certificate from AWS Certificate Manager and created CNAME (provided by ACM after requesting certificate) record in the hosted zone.
2) After the certificate is issued, I edited the listener from EC2 >> Load Balancer >> Listener and changed the protocol from HTTP to HTTPS and also allowed port on Security groups.
3) Also, I changed, the SITE URL from WordPress database and changed it from "http://example.com" to "https://example.com" but it was not working.
4) So I went to Elastic Beanstalk >> Configuration >> Load Balancer and added listener. After the environment is saved and restarted, still, the site was not running on HTTPS [ HTTP 408 ERROR IS SHOWN ]. But if I change SITE URL to "http://example.com", it works
I have found a solution, which says to use RedirectURL and set it to server config but I don't want to do that.
I also found this solution which suggest to Export Zone File and import it to AWS hosted zone. But whenever I click Export Zone File(Unix), the file downloaded is shown empty. I tried this for other accounts, still, this problem exists. So I did not do that.
Sorry for the long story, but I really need this help.
I have solved the issue.
In my load balancer port configuration, I previously set load Balancer port 443 and instance 443. here what I need to do is to call the load balancer on port 443 and backend make the backend call on port 80 and enable https on WordPress.
So I kept load balancer port 443 and changed the instance port to 80. After that, on the browser, there was too many redirects error shown. So then what I needed to do is that add $_SERVER['HTTPS'] = 'on' on wp-config. And then everything was running smoothly.
I hope this will help if some

AWS send http request through elastic load balancer

I am a beginner and trying to send http requests through elastic load balancer. Could anybody explain briefly about the steps that I need?
set up Elastic Load Balancer A
get DNS of the Elastic Load Balancer A
register EC2 instances to the Elastic Load Balancer A
send traffic to the DNS of Elastic Load Balancer A
But I have no idea what kind of configuration or set up I need to put in the EC2 instances that are to be attached to this Elastic Load Balancer A. Do I need to set up Listener? If so, how do I set this?
I just want to send http request under the ip of EC2s and Elastic Load Balancer A so that I get different IPs assigned to each requests.
Thanks a lot!
By default, Amazon EC2 instances behind an Elastic Load Balancer serve traffic on port 80 (HTTP). When creating the Load Balancer, you can configure which ports should receive traffic (80, 442, 1024+).
Think of it this way... The Load Balancer simply sits "in front" of the EC2 instances. If a user was to go directly to your EC2 instance directly (eg enter its IP Address in a web browser), they should see a website. Going to the Load Balancer does the same thing, but it distributes the requests amongst multiple EC2 instances.
So, in most cases, it's just a matter of running a web server or app on your EC2 instance running on port 80.

Amazon Elastic Load Balancer with IIS

I have and ASP.NET MVC application hosted under IIS on a EC2 Instance.
I can access the application without any problems through the EC2 DNS once I set the proper binding in IIS
http - EC2 DNS - port 80
But if I add an Elastic Load Balancer and then I try to access that web application through the Load Balancer DNS the only way I can get it working is by adding an empty binding in IIS
"empty host name for http:80"
But this can't be ok.
If I don't add this the ELB sees my instance as unhealthy and when I access the ELB DNS I just get a HTTP 503 Service Unavailable.
The EC2 instance is in a Auto Scaling group.
I've tried modifying the security group of that instance from allowing all IPs for HTTP:80 to only allowing the Load Balancer Ip (amazon-elb/amazon-elb-sg)
Any ideas what I'm doing wrong?
Thanks
I am running several IIS servers behind ELB. Here are things that you need to ensure:
The ELB security group is allowed to accept port 80 traffic from anywhere (0.0.0.0/0)
The ELB security group is allowed to send outbound port 80 traffic to your EC2 instance where IIS is running. This point was valid for the ELBs that are set inside VPC. Hence please ignore this.
The EC2 security group of the EC2 instance where you have IIS running, should be allowed to accept port 80 traffic from the Load Balancer.
If this whole set-up is in VPC then there are few other things you need to check. so let us know if this is the case
No configuration changes on IIS are needed for sure.

Resources