Redirect HTTP to HTTPS when using ELB
Background – I have my site hosted on AWS EC2 server which is behind ELB (Elastic Load Balancing). I wanted my site to work on HTTPS. So I provisioned SSL certificate through AWS certificate manager and uploaded it on ELB. ELB receives traffic on both ports 80 and 443 and forwards it to single port 80 on server.