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 in AWS by Rishi
32 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 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,090 points
41 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
• 56,940 points
54 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
• 56,940 points
103 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
• 56,940 points
309 views
0 votes
1 answer
0 votes
1 answer
+1 vote
10 answers
+1 vote
3 answers

Unable to login to parse dashboard on AWS

I had the same issue, which I ...READ MORE

answered Aug 28, 2018 in AWS by eatcodesleeprepeat
• 4,670 points
690 views