Bug 434897

Summary: Hack for proxy pass through to get real client IP address
Product: [Community] Bugzilla Reporter: David Lawrence <dkl>
Component: Bugzilla GeneralAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 2.18   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://en.wikipedia.org/wiki/X-Forwarded-For
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-26 04:23:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to pass through real client IP address when going through a proxy none

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