AWS Aplication Load Balancer HTTP to HTTPS with EC2 instance










2















I have a EC2 instance running a Node.Js server on Ubuntu.



My goals are:



  1. Connect my hosted zone to the EC2 instance

  2. Route all incoming traffic from port 80 to port 3000 (because my server runs on port 3000)

  3. and most importantly Use an Application Load Balancer to forward all requests to HTTPS (I already created a SSL Certificate in the Certificate Manager).

Currently, I am only able to open the website with the EC2 intances' Public Ip on port 3000 (http://prntscr.com/livali). Https requests or Http to port 80 don't work (http://prntscr.com/livau2). Altought a made an A record on my hosted zone with the instances' Public Ip, it's not possible to open the instance via the hosted zone (http://prntscr.com/liv9no).



I am really confused, as I am somehow not able to get this up and running. I would really appreciate a step by step guide on how to set this whole thing up.










share|improve this question


























    2















    I have a EC2 instance running a Node.Js server on Ubuntu.



    My goals are:



    1. Connect my hosted zone to the EC2 instance

    2. Route all incoming traffic from port 80 to port 3000 (because my server runs on port 3000)

    3. and most importantly Use an Application Load Balancer to forward all requests to HTTPS (I already created a SSL Certificate in the Certificate Manager).

    Currently, I am only able to open the website with the EC2 intances' Public Ip on port 3000 (http://prntscr.com/livali). Https requests or Http to port 80 don't work (http://prntscr.com/livau2). Altought a made an A record on my hosted zone with the instances' Public Ip, it's not possible to open the instance via the hosted zone (http://prntscr.com/liv9no).



    I am really confused, as I am somehow not able to get this up and running. I would really appreciate a step by step guide on how to set this whole thing up.










    share|improve this question
























      2












      2








      2








      I have a EC2 instance running a Node.Js server on Ubuntu.



      My goals are:



      1. Connect my hosted zone to the EC2 instance

      2. Route all incoming traffic from port 80 to port 3000 (because my server runs on port 3000)

      3. and most importantly Use an Application Load Balancer to forward all requests to HTTPS (I already created a SSL Certificate in the Certificate Manager).

      Currently, I am only able to open the website with the EC2 intances' Public Ip on port 3000 (http://prntscr.com/livali). Https requests or Http to port 80 don't work (http://prntscr.com/livau2). Altought a made an A record on my hosted zone with the instances' Public Ip, it's not possible to open the instance via the hosted zone (http://prntscr.com/liv9no).



      I am really confused, as I am somehow not able to get this up and running. I would really appreciate a step by step guide on how to set this whole thing up.










      share|improve this question














      I have a EC2 instance running a Node.Js server on Ubuntu.



      My goals are:



      1. Connect my hosted zone to the EC2 instance

      2. Route all incoming traffic from port 80 to port 3000 (because my server runs on port 3000)

      3. and most importantly Use an Application Load Balancer to forward all requests to HTTPS (I already created a SSL Certificate in the Certificate Manager).

      Currently, I am only able to open the website with the EC2 intances' Public Ip on port 3000 (http://prntscr.com/livali). Https requests or Http to port 80 don't work (http://prntscr.com/livau2). Altought a made an A record on my hosted zone with the instances' Public Ip, it's not possible to open the instance via the hosted zone (http://prntscr.com/liv9no).



      I am really confused, as I am somehow not able to get this up and running. I would really appreciate a step by step guide on how to set this whole thing up.







      amazon-web-services amazon-ec2 https amazon-route53 amazon-elb






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 20:22









      FlorianFlorian

      45423




      45423






















          2 Answers
          2






          active

          oldest

          votes


















          3














          If you already have a SSL certificate it is secure to use only port 443 instead of port 80.



          1) Create an internet facing Application Load Balancer that listens on port 443 and routes traffic to your EC2 instance on port 3000.



          2) Redirect users to HTTPS when accessing your domain on HTTP
          https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions



          2) Add an A record to point your domain name to the Load Balancer's public DNS.






          share|improve this answer























          • How do I associate the Application Load Balancer with my EC2 instance?

            – Florian
            Nov 16 '18 at 18:37











          • You can add it as a target group. Check the AWS documentation. Pretty straightforward.

            – ben5556
            Nov 16 '18 at 19:29


















          0














          These are web server concerns rather than DNS concerns. You'll need to set up something like NGINX or Apache to proxy port 80 to port 3000. See Apache redirect to another port for information.



          You can also force HTTPS with a rewrite rule in Apache: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS



          Another option for forcing HTTPS is to create a CloudFront distribution and use that. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327359%2faws-aplication-load-balancer-http-to-https-with-ec2-instance%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            If you already have a SSL certificate it is secure to use only port 443 instead of port 80.



            1) Create an internet facing Application Load Balancer that listens on port 443 and routes traffic to your EC2 instance on port 3000.



            2) Redirect users to HTTPS when accessing your domain on HTTP
            https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions



            2) Add an A record to point your domain name to the Load Balancer's public DNS.






            share|improve this answer























            • How do I associate the Application Load Balancer with my EC2 instance?

              – Florian
              Nov 16 '18 at 18:37











            • You can add it as a target group. Check the AWS documentation. Pretty straightforward.

              – ben5556
              Nov 16 '18 at 19:29















            3














            If you already have a SSL certificate it is secure to use only port 443 instead of port 80.



            1) Create an internet facing Application Load Balancer that listens on port 443 and routes traffic to your EC2 instance on port 3000.



            2) Redirect users to HTTPS when accessing your domain on HTTP
            https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions



            2) Add an A record to point your domain name to the Load Balancer's public DNS.






            share|improve this answer























            • How do I associate the Application Load Balancer with my EC2 instance?

              – Florian
              Nov 16 '18 at 18:37











            • You can add it as a target group. Check the AWS documentation. Pretty straightforward.

              – ben5556
              Nov 16 '18 at 19:29













            3












            3








            3







            If you already have a SSL certificate it is secure to use only port 443 instead of port 80.



            1) Create an internet facing Application Load Balancer that listens on port 443 and routes traffic to your EC2 instance on port 3000.



            2) Redirect users to HTTPS when accessing your domain on HTTP
            https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions



            2) Add an A record to point your domain name to the Load Balancer's public DNS.






            share|improve this answer













            If you already have a SSL certificate it is secure to use only port 443 instead of port 80.



            1) Create an internet facing Application Load Balancer that listens on port 443 and routes traffic to your EC2 instance on port 3000.



            2) Redirect users to HTTPS when accessing your domain on HTTP
            https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#redirect-actions



            2) Add an A record to point your domain name to the Load Balancer's public DNS.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 16 '18 at 3:43









            ben5556ben5556

            1,9722310




            1,9722310












            • How do I associate the Application Load Balancer with my EC2 instance?

              – Florian
              Nov 16 '18 at 18:37











            • You can add it as a target group. Check the AWS documentation. Pretty straightforward.

              – ben5556
              Nov 16 '18 at 19:29

















            • How do I associate the Application Load Balancer with my EC2 instance?

              – Florian
              Nov 16 '18 at 18:37











            • You can add it as a target group. Check the AWS documentation. Pretty straightforward.

              – ben5556
              Nov 16 '18 at 19:29
















            How do I associate the Application Load Balancer with my EC2 instance?

            – Florian
            Nov 16 '18 at 18:37





            How do I associate the Application Load Balancer with my EC2 instance?

            – Florian
            Nov 16 '18 at 18:37













            You can add it as a target group. Check the AWS documentation. Pretty straightforward.

            – ben5556
            Nov 16 '18 at 19:29





            You can add it as a target group. Check the AWS documentation. Pretty straightforward.

            – ben5556
            Nov 16 '18 at 19:29













            0














            These are web server concerns rather than DNS concerns. You'll need to set up something like NGINX or Apache to proxy port 80 to port 3000. See Apache redirect to another port for information.



            You can also force HTTPS with a rewrite rule in Apache: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS



            Another option for forcing HTTPS is to create a CloudFront distribution and use that. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html






            share|improve this answer



























              0














              These are web server concerns rather than DNS concerns. You'll need to set up something like NGINX or Apache to proxy port 80 to port 3000. See Apache redirect to another port for information.



              You can also force HTTPS with a rewrite rule in Apache: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS



              Another option for forcing HTTPS is to create a CloudFront distribution and use that. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html






              share|improve this answer

























                0












                0








                0







                These are web server concerns rather than DNS concerns. You'll need to set up something like NGINX or Apache to proxy port 80 to port 3000. See Apache redirect to another port for information.



                You can also force HTTPS with a rewrite rule in Apache: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS



                Another option for forcing HTTPS is to create a CloudFront distribution and use that. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html






                share|improve this answer













                These are web server concerns rather than DNS concerns. You'll need to set up something like NGINX or Apache to proxy port 80 to port 3000. See Apache redirect to another port for information.



                You can also force HTTPS with a rewrite rule in Apache: https://wiki.apache.org/httpd/RewriteHTTPToHTTPS



                Another option for forcing HTTPS is to create a CloudFront distribution and use that. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 21:47









                bwestbwest

                6,60711845




                6,60711845



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53327359%2faws-aplication-load-balancer-http-to-https-with-ec2-instance%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    政党

                    天津地下鉄3号線