server {
# all traffic, secure or otherwise, comes in on 80 from the ELB
listen 80;
# ELB stores the protocol used between the client
# and the load balancer in the X-Forwarded-Proto request header.
# Check for 'https' and redirect if not
if ($http_x_forwarded_proto != 'https') {
rewrite ^ https://$host$request_uri? redirect;
}
server_name your-secure-site.com www.your-secure-site.com;
.... (the rest of your config)
}
Goal
Redirect
http
tohttps
Reference
https://codyparker.com/force-entire-site-ssl-nginx-behind-aws-load-balancer/