Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active March 21, 2018 14:31
Show Gist options
  • Save strangerstudios/e4245139b6b4b8b97072629a149c220c to your computer and use it in GitHub Desktop.
Save strangerstudios/e4245139b6b4b8b97072629a149c220c to your computer and use it in GitHub Desktop.
Copy HTTP_X_FORWARDED_PROTO to HTTPS so WordPress can detect is_ssl()
//copy HTTP_X_FORWARDED_PROTO config to HTTPS var in $_SERVER
if((empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && $_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