CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#12376] Manage HAPROXY headers for real IP & Protocol

avatar
Created By: atz (atz6975)
Date Submitted: 2020-10-14 13:46

Assigned To:
Resolution: None
State: Open
Summary:
Manage HAPROXY headers for real IP & Protocol
Detailed Description:
When Haproxy is "in the middle", the following peaces of code need to be
adjusted to manage the client's original IP & protocol.


cms_utils::get_real_ip() ?
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip =
$_SERVER['HTTP_X_FORWARDED_FOR'];
=>>>>>>>To add Just before the validate IP filter


Same for cmsapp::is_http_request()
if( !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https' ) return TRUE;
=>>>>>>>>To add before return FALSE;

History