Skip to content

Instantly share code, notes, and snippets.

@dotkebi
Forked from miguelmota/setup.config
Created March 23, 2020 14:21
Show Gist options
  • Save dotkebi/466a5644471f0b2b647165ff52f17fe1 to your computer and use it in GitHub Desktop.
Save dotkebi/466a5644471f0b2b647165ff52f17fe1 to your computer and use it in GitHub Desktop.
Elastic Beanstalk NGINX rewrite http to https using .ebextensions
files:
"/etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf":
mode: "000755"
owner: root
group: root
content: |
server {
listen 80;
gzip on;
if ($http_x_forwarded_proto != 'https') {
rewrite ^(.*) https://$host$1 redirect;
}
location / {
proxy_pass http://docker;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment