Bug 434897 - Hack for proxy pass through to get real client IP address
Summary: Hack for proxy pass through to get real client IP address
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Bugzilla General
Version: 2.18
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact:
URL: http://en.wikipedia.org/wiki/X-Forwar...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-26 04:16 UTC by David Lawrence
Modified: 2025-10-16 23:17 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-02-26 04:23:37 UTC
Embargoed:


Attachments (Terms of Use)
Patch to pass through real client IP address when going through a proxy (863 bytes, patch)
2008-02-26 04:16 UTC, David Lawrence
no flags Details | Diff

Description David Lawrence 2008-02-26 04:16:31 UTC
# HACK FOR PROXY PASS-THROUGH
# First check for SERVER_SOFTWARE because it's required to be
# defined for all requests in the CGI spec
# Then if client is one of the proxy servers then we try to use the
# HTTP_X_FORWARDED_FOR address as the client's real IP address
if ( exists $ENV{SERVER_SOFTWARE} and $ENV{REMOTE_ADDR} =~ /^10\.8\.2\.15\d$/ ) {
    $ENV{REMOTE_ADDR} = $ENV{HTTP_X_FORWARDED_FOR} =~ /([^,\s]+)$/;
}

Comment 1 David Lawrence 2008-02-26 04:16:31 UTC
Created attachment 295870 [details]
Patch to pass through real client IP address when going through a proxy


Note You need to log in before you can comment on or make changes to this bug.