I want to redirect all of my HTTP requests to https in AWS. I use ELB for ssl certificate and using ubuntu(64-bit) os.
You have two options:
1) Use cloudfront in front of your ELB, and configure it to force everything to HTTPS
2) Add a rewrite rule to your web server configuration to redirect to https. Note that you will need to check X-Forwarded-Proto to determine if the original request was secure or not.
The new Application ELB can redirect HTTP to HTTPS. Just open Listeners
tab and follow View/edit rules
link for the HTTP : 80
listener. Then, you just edit default rule, remove default action and select Redirect
option. Here you can set protocol (default is https), define custom port, modify server name, path, query string etc.
You cannot use only ELB to redirect request from HTTP to HTTPS. You must install some Reverse Proxy tools (like nginx or vanish, apache) to redirect all HTTP Request to HTTPS.Your ELB will listen both HTTP/HTTPS but your server will rewrite HTTP requests. For example from aws https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/
On the console go to EC2 > Load balancers > your load balancer > listeners
Here you should have 2 rules: HTTP : 80 and HTTPS : 443
You just have to:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.