Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created March 31, 2015 17:40
Show Gist options
  • Save halkeye/0dea284e6218fa49614b to your computer and use it in GitHub Desktop.
Save halkeye/0dea284e6218fa49614b to your computer and use it in GitHub Desktop.
nginx+cloudflare redirect
location / {
if ($http_cf_visitor !~ https) {
rewrite ^(.*) https://$http_host$1 permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment