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 17, 2019 in AWS by Rishi
1,000 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 17, 2019 by Vedant

Related Questions In AWS

+2 votes
1 answer

How to redirect EC2 Elastic Load Balancer from HTTP to HTTPS?

Hi@akhtar, AWS Application Load Balancers now support native ...READ MORE

answered Aug 13, 2020 in AWS by MD
• 95,460 points
2,421 views
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,170 points
1,982 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
• 58,020 points
963 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
• 58,020 points
1,674 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,670 points
3,144 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP