Skip to content

Instantly share code, notes, and snippets.

@Ben-Atherton
Created February 8, 2017 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ben-Atherton/e53b128635a585af096e8a80429a49dc to your computer and use it in GitHub Desktop.
Save Ben-Atherton/e53b128635a585af096e8a80429a49dc to your computer and use it in GitHub Desktop.
How to force HTTPS behind an Amazon Web Services Elastic Load Balancer
server {
listen 80;
location / {
if ($http_x_forwarded_proto != 'https') {
rewrite ^ https://$host$request_uri? permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment