Redirect HTTP traffic to HTTPS request on ELB

0 votes

I have a load balancer set to two of my ec2 instances. I would like to redirect all the HTTP traffic to HTTPS request on the load balancer. I'm using an Nginx server.  

May 16, 2019 in AWS by Rishi
58 views

1 answer to this question.

0 votes

Change your server config file

if ($http_x_forwarded_proto = 'http') {
    return 301 https://yourdomain.com$request_uri;
}

ELB sets X-Forwarded-Proto header, you can use it to detect if the original request was to HTTP and redirect to HTTPS then.

answered May 16, 2019 by Vedant

Related Questions In AWS

0 votes
1 answer

How to make API Gateway accept http instead of https?

You can put a Cloudfront distribution in ...READ MORE

answered Aug 21, 2018 in AWS by Archana
• 4,150 points
53 views
+1 vote
1 answer

Can we use AWS Public DNS as Domian name to enable https on our instance

I don't believe you can get a ...READ MORE

answered Aug 23, 2018 in AWS by Priyaj
• 57,510 points
69 views
+1 vote
1 answer

Redirect working from www.xyz.com to https://xyz.com but not from https://www.xyz.com

Make sure you have created the certificate ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 57,510 points
142 views
0 votes
1 answer

Configure Application load balancer to route http to https in Elastic beanstalk

From this document: To update your Elastic Beanstalk environment to ...READ MORE

answered Sep 6, 2018 in AWS by Priyaj
• 57,510 points
422 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
10 answers
+3 votes
3 answers

Unable to login to parse dashboard on AWS

During the first time boot, the application ...READ MORE

answered Apr 30, 2018 in AWS by Cloud gunner
• 4,630 points
821 views