contao/test — Issue #404: install (and probably working) bug using nginex
Author: importer
Created: 2011-11-29 05:05:49+00:00
State: open
Labels: backend, Defect, Duplicate

Environment.php line 305

```
$this->arrCache['url'] = ($this->ssl() ? 'https://' : 'http://') . (strlen($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] . '/' : _) . $_SERVER['HTTP_HOST'];
```

broken, when header are both HTTP_HOST and HTTP_X ..., for example, when nginex is used.

and Environment->base is doubled (http://google.com -> http://google.com/google.com)

fast and dirty workaround:

```
$this->arrCache['url'] = ($this->ssl() ? 'https://' : 'http://') . (strlen($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] . '/' : $_SERVER['HTTP_HOST']);
```

--- _Originally created by anonymous on January 8th, 2009, at 08:56pm (ID 404)_