[wp-trac] [WordPress Trac] #19337: is_ssl() fails behind nginx proxy
WordPress Trac
wp-trac at lists.automattic.com
Tue Nov 29 10:46:35 UTC 2011
#19337: is_ssl() fails behind nginx proxy
-----------------------------------------+------------------------------
Reporter: niklasbr | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Security | Version: 3.3
Severity: normal | Resolution:
Keywords: has-patch reporter-feedback |
-----------------------------------------+------------------------------
Comment (by dd32):
In your case, you need this in your wp-config.php file (probably best
placed at the top of the file):
{{{
$_SERVER['HTTP_REMOTE_ADDR'] = $_SERVER['HTTP_REMOTE_ADDR'];
$_SERVER['HTTPS'] = !empty($_SERVER['HTTP_HTTPS']) ?
$_SERVER['HTTP_HTTPS'] : 0;
}}}
That should work for any nginx proxies using the default reverse proxy
rules, extra lines would be needed for those using sub-directory proxying,
or using older nginx versions, or using other reverse proxies (varnish,
squid, etc)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19337#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list