Skip to main content

how to redirect http request to https in application load balancer at aws

Why we want to do this - Means redirection of HTTP to https or non-www version to https://www version. 

It's really helpful for SEO and the search engine has only one copy of your website. Otherwise, what happen Google/other search engine bots treat your website as a different website.

So I am assuming that you have already had an AWS account and you have a running instance in it and your website already configured on Route 53 if not then you do it by yourself if you have any questions then you can write in the comment box. 

Steps for Redirection of an HTTP request to HTTPS in Application Load Balancer at AWS


  1. Create an SSL certificate or use your own certificate in Certificate manager/IAM (it is required for application load balancer)
  2. Create an application load balancer 
  3. Configure security group (skips if its already open)
  4. Configure port 80 to redirection to 443 
  5. Set new DNS to your Route 53 


  1. First log in to AWS Account and Go to EC2 Instance and > Load Balancer
  2. Click on Create Load Balancer

        Step 3: Now we have to choose - Application Load Balancer and click on Create



        Step 4 Enter the information as per below image 
             You can choose Name - like i chosen - dvo-application-load-balncr
              You have to allow both the port 80 and 443 
                then choose the availability zone          
            Once you done then click on Next Configure security group in bottom


Step 5: Here you can choose your certificate or you can create or you can also import external certificates which you may buy from other companies/websites.


Step 6 : Configure Security group  (Here i have already created by security group and i allowed few ports as per my application requirements.). Then click on next




Step 7: Basically we have our EC2 instance and our Tomcat is running on port 80 so we have kept as it. 

Now click on Register targets

Step 8: Register Targets (means we have to attach our running ec2 instance to this application load balancer and i attached it)



Step 9 Is review of your configuration 

Step 10: If its success like this then your application load balancer is ready. 


Now you can click on close button. 

Now you can see our application load balancer is active. (Actually, I kept a screenshot of another tab like a listener)



But here in Listeners you can see we have port 80 and 443 for https but in 443 we have SSL Certificate but in port 80 http we don't have and its default action is forwarding so instead of forwarding we have to make a change like a redirect. So click on View/edit rules in Rules column for HTTP 80.

It will show like this so we have to edit these rules here 

The first click on Edit pencil icon on top then it will show one more pencil icon near this IF row click on it. 



Now we have to delete this Then click in last one. 





Once you change it will be look like this.

Now we have to just need to update the DNS of this load balancer in Route 53 in a A record set.

and we hare done. 



Comments

  1. Great Article
    Cloud Computing Projects


    Networking Projects

    Final Year Projects for CSE


    JavaScript Training in Chennai

    JavaScript Training in Chennai

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete
  2. cogenx providing AWS Training in Chennai. Studying AWS in cogenx Technology will give a good hipe in career.

    ReplyDelete
  3. Great Post, This is giving more valuable information and contains a lot of information. Also visit our website app developers toronto
    mobile app development company toronto

    ReplyDelete

Post a comment

Popular posts from this blog

Digital Marketing

What actually is Digital Marketing?
This post will help you understand the insights of Digital MarketingWhat is Digital Marketing?Digital Marketing is an integral part of the overall marketing strategies of any business. It basically covers the advertisement of products/services/business/brand via digital channels. The digital channels could be of any type like websites, search engines, social media, emails, SMS, and MMS. In case if you're using all these digital channels for the marketing, make sure to have all the statistics & workflow of your campaigns via marketing automation. What are the types of digital marketing?Well, there are 6 core digital marketing types: Search Engine Optimization (SEO): Search Engine Optimization is nothing but a long-term process of improving your website rankings on search engine results pages (SERPs), which in turn has a wide range of tactics & strategies to implement. Although there is no specific method or a  specific formula with which an …

Android & iOS Application Development For Dummies

App Development ProcessApp Development Process explained in the most simplified way This tutorial will guide all the beginners how an app is developed from scratch and will help in letting the beginners know how the process works.Phase-1 (Conceptualization): Even a concept or an idea starts with an approach to introduce something after acknowledging the inkling of amiss or what's missing in the existing market. Developing the aftermath ideas involves critical questioning and rational thinking towards the wire-framing stage. Phase-2 (Design): After analyzing the idea thoroughly and looking through all possible dimensions, comes the design part, where a feasible layout of the model is planned to move ahead for the further development processes. Phase-3 (Coding): Development process begins with designing a user-friendly UI. Prototypes of the model are prepared with the combined agreement of developers and designers to increase the efficiency and capitalization. The expedience checking r…

Amazon EC2 Server Setup & Installing JDK 8 and Tomcat 8, Running on Port 80 & 443 and Redirect Request from port 80 to 8080 and 443 to 8443

Amazon EC2 Server Setup & Installing JDK 8 and Tomcat 8, Running on Port 80 & 443 and Redirect Request from port 80 to 8080 and 443 to 8443.Step 1 : Log in to youraws account by following this link then click on my account and choose option aws management console.
Note: I am assuming you created your account with aws and you are ready with you account if you haven’t done then you can check out on google you will get many and it's a straight forward steps if you have still problem while creating an account you can comment in comment box i will also provide tutorial for that.
Once you logged in aws management console you are able to see window like this one


Note : Before we go ahead we have to select proper reason from right and side.I choose ohio region for this example.
Step 2 : Now you have to choose EC2 Server from Services tab on left side top corner then choose EC2 Services from “Compute option”

You will get window like this one and right now i have one instance is running for…