[wp-trac] [WordPress Trac] #61915: fix(is_ssl): adds check for ssl when behind a proxy or load balancer
WordPress Trac
noreply at wordpress.org
Fri Aug 23 13:14:10 UTC 2024
#61915: fix(is_ssl): adds check for ssl when behind a proxy or load balancer
--------------------------+------------------------
Reporter: tbfVladd | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Security | Version: 6.6.1
Severity: normal | Resolution: duplicate
Keywords: has-patch | Focuses:
--------------------------+------------------------
Comment (by tbfVladd):
Thanks for the reply - sorry, I didn't see it as I was following the
contribution guidelines for code and raised a PR.
From the links you've provided, I think I'll do this:
https://core.trac.wordpress.org/ticket/15733#comment:1
> You should set `$_SERVER['HTTPS']` to equal
`$_SERVER['HTTP_X_FORWARDED_PROTO']` in your wp-config.php file. This
isn't an issue for core to solve.
For anyone else reading this, add this to your `wp-config.php`
{{{#!php
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && ('https' ===
strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) ) ) {
$_SERVER['HTTPS'] = 'On';
}
}}}
Cheers,
Andrew 🙂
Replying to [comment:1 swissspidy]:
> Hi there and welcome to WordPress Trac!
>
> This has come up numerous times in the past, a quick search would have
easily revealed that.
>
> There are some discussions in #15733 and #31288 about why this isn't
something core intends to do. They also provide suggestions how to address
this on your custom environment (e.g. through wp-config)
>
> I'm closing this as a duplicate of the latter as it has most context of
the two.
>
> I'd recommend leaving a comment there if you have any new information.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61915#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list