Skip to content

Instantly share code, notes, and snippets.

@april
Created December 20, 2017 18:20
Show Gist options
  • Save april/2319fcedbfd92a0f6b5dfc7f0d0b2bd4 to your computer and use it in GitHub Desktop.
Save april/2319fcedbfd92a0f6b5dfc7f0d0b2bd4 to your computer and use it in GitHub Desktop.
server {
listen 58080;
# Disable the port number in redirects, since it's behind a load balancer
port_in_redirect off;
location / {
if ($http_x_forwarded_proto != 'https') {
return 301 https://$host$request_uri;
}
}
location /__lbheartbeat__ {
access_log off;
default_type text/plain;
return 200 'OK';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment