<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=299788&amp;fmt=gif">

Load Balancer Extraordinaire

Technology, AWS, DevOps

During AWS implementations we've always used an Elastic Load Balancer (ELB) in the public subnets in order to route traffic to the application instances in the private subnet. NGINX lived on the application instances. NGINX handled sending encrypted app traffic (via HTTPS) to the load balancer as well as handling the redirect of all traffic from port 80 (HTTP) to 443 (HTTPS).

This was until Amazon Web Services (AWS) announced redirects and fixed responses for their Application Load Balancer (ALB, think ELB version 2). This allows us to do the same HTTP to HTTPS redirection without having to expose the application services on port 80. This increases security and centralizes the redirect configuration from each application instance into the ALB configuration.

How to Deploy with CloudFormation

Most of our AWS deployments are done via CloudFormation. To implement the redirect described above, you will need to set an ALB Listener such as:

JiraAlbHttpListener:
Type: "AWS::ElasticLoadBalancingV2::Listener"
Properties:
LoadBalancerArn: !Ref JiraApplicationLoadBalancer Port: 80
Protocol: HTTP DefaultActions: - RedirectConfig: Host: "#{host}" Path: "/#{path}" Port: "443" Protocol: "HTTPS" Query: "#{query}" StatusCode: "HTTP_302" Type: redirect

How to Deploy with AWS Console

  1. Browse to the EC2 Service.
  2. Click on Load Balancers
  3. Create an Application Load Balancer and add a Listener for HTTP:80.
  4. Click View/edit rules and create the following rule:

Managing JIRA at Scale White Paper

TAGS: Technology, AWS, DevOps

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Subscribe to Our Newsletter

Recent Blog Posts