Skip to content

Instantly share code, notes, and snippets.

@suzannealdrich
Created February 23, 2015 22:44
Show Gist options
  • Save suzannealdrich/bb693a63fcab375024b5 to your computer and use it in GitHub Desktop.
Save suzannealdrich/bb693a63fcab375024b5 to your computer and use it in GitHub Desktop.
HTTPS all the things!
// CloudFlare Connecting IP
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}
// CloudFlare SSL Enabled
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS'] = 'on';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment