Skip to content

Instantly share code, notes, and snippets.

@jose-serrao
Last active April 25, 2018 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jose-serrao/daedfbc92ccc0efc33aa076ab7c9c959 to your computer and use it in GitHub Desktop.
Save jose-serrao/daedfbc92ccc0efc33aa076ab7c9c959 to your computer and use it in GitHub Desktop.
https://www.variantweb.net/blog/wordpress-behind-an-nginx-ssl-reverse-proxy/
/**
* Handle SSL reverse proxy
*/
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment