View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005685 | OXID eShop (all versions) | 4.08. Cache | public | 2014-03-07 13:33 | 2014-09-10 10:20 |
Reporter | arvydas_vapsva | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Target Version | 4.7.14 / 5.0.14 | Fixed in Version | 4.9.0_5.2.0_RC1 | ||
Summary | 0005685: Varnish issues on balanced system | ||||
Description | We had load balancer/varnish server and two Apache web servers behind. HIT rate was very low, until we found out, that $_SERVER["HTTP_HOST"] parameter was filled in with balancer IP address, not with domain name (domain name was actually written into $_SERVER['HTTP_X_FORWARDED_HOST']), thus oxUtilsServer::isCurrentUrl( $sURL ) was always returning false, causing ReverseProxy headers to "no-cache". Our hack was to append config.inc.php with $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; | ||||
Tags | No tags attached. | ||||
Theme | All | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Same problem exist without Varnish. $this->getServerVar( 'HTTP_HOST' ) returned IP address not domain address. This way method isCurrentUrl() decided that URL is not same and SID was added to all links. |
|
Additional logic to check both cases added: public function isCurrentUrl($sURL) { // Missing protocol, cannot proceed, assuming true. if (!$sURL || (strpos($sURL, "http") !== 0)) { return true; } $sServerHost = $this->getServerVar('HTTP_HOST'); $blIsCurrentUrl = $this->_isCurrentUrl($sURL, $sServerHost); if (!$blIsCurrentUrl) { $sServerHost = $this->getServerVar('HTTP_X_FORWARDED_HOST'); if ($sServerHost) { $blIsCurrentUrl = $this->_isCurrentUrl($sURL, $sServerHost); } } return $blIsCurrentUrl; } |
|
oxUtilsUrl::getCurrentUrl still relies only on HTTP_HOST. HTTP_X_FORWARDED_HOST is too much unreliable. |