Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P1714
lb.php
Active
Public
Actions
Authored by
epriestley
on Feb 2 2015, 9:11 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F281208: lb.php
Feb 2 2015, 9:11 PM
2015-02-02 21:11:41 (UTC+0)
Subscribers
None
// If this request is coming from within the cluster, we'll trust HTTP
// headers added by the load balancer. We do not trust these headers for
// requests which do not originate from within the cluster, because they
// are client-controlled if the request is being received directly.
if
(
PhacilityServices
::
isClusterRequest
())
{
// Since we terminate SSL at the ELB, requests are normally HTTP by the
// time they reach the server, even if they were originally HTTPS. The
// ELB sets this header to indicate that the original request was HTTPS.
if
(
idx
(
$_SERVER
,
'HTTP_X_FORWARDED_PROTO'
)
==
'https'
)
{
$_SERVER
[
'HTTPS'
]
=
true
;
}
$forwarded_for
=
idx
(
$_SERVER
,
'HTTP_X_FORWARDED_FOR'
);
if
(
$forwarded_for
)
{
$_SERVER
[
'REMOTE_ADDR'
]
=
$forwarded_for
;
}
}
Event Timeline
epriestley
edited the content of this paste.
(Show Details)
Feb 2 2015, 9:11 PM
2015-02-02 21:11:41 (UTC+0)
epriestley
changed the title of this paste from untitled to
lb.php
.
epriestley
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment