Skip to content

Instantly share code, notes, and snippets.

@ajaegers
Last active August 29, 2015 14:13
Show Gist options
  • Save ajaegers/cb8c414b4509e6c9e25c to your computer and use it in GitHub Desktop.
Save ajaegers/cb8c414b4509e6c9e25c to your computer and use it in GitHub Desktop.
[Fix] Wordpress HTTPS detection improved (detects https under haproxy HTTP_X_FORWARDED_PROTO). Fix redirects.
//
// Best way to fix it even it'll never been fixed in WordPress core
if ($_SERVER['HTTP_PROXY_HTTPS'] == 'https') $_SERVER['HTTPS']='on';
//
// OR
//
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';
// more on http://codex.wordpress.org/Administration_Over_SSL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment