Created
July 12, 2018 10:30
-
-
Save eveyrat/cff3b71b514bcd237f05a9627f31cb54 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Debug\Debug; | |
/** @var \Composer\Autoload\ClassLoader $loader */ | |
$loader = require __DIR__.'/../app/autoload.php'; | |
Debug::enable(); | |
$kernel = new AppKernel('dev', true); | |
$kernel->loadClassCache(); | |
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter | |
//Request::enableHttpMethodParameterOverride(); | |
$request = Request::createFromGlobals(); | |
// AWS settings http://symfony.com/doc/2.8/request/load_balancer_reverse_proxy.html | |
Request::setTrustedProxies([ | |
'127.0.0.1', | |
$request->server->get('REMOTE_ADDR'), | |
]); | |
Request::setTrustedHeaderName(Request::HEADER_FORWARDED, null); | |
$response = $kernel->handle($request); | |
$response->send(); | |
$kernel->terminate($request, $response); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment