getEnvironment(), ['dev', 'test'], true)) { $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); $bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle(); } return $bundles; } public function getRootDir() { return __DIR__; } public function getCacheDir() { return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); } public function getLogDir() { return dirname(__DIR__) . '/var/logs'; } public function registerContainerConfiguration(LoaderInterface $loader) { $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); } /** * {@inheritdoc} */ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) { if (false === $this->booted) { $this->boot(); } // se puede sacar la variable nginx-proxy porque es el nombre del docker y puede variar // con REMOTRA_ADDR obtengo el mismo valor (http://symfony.com/doc/current/deployment/proxies.html) //gethostbyname("nginx-proxy") == $request->server->get('REMOTE_ADDR') if ($this->container->hasParameter("nginx_name")) { Request::setTrustedProxies( array('127.0.0.1', $this->container->getParameter("nginx_name")), Request::HEADER_X_FORWARDED_FOR); } return parent::handle($request, $type, $catch); } }