Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Latest commit

 

History

History
48 lines (40 loc) · 1.12 KB

redirect many times.md

File metadata and controls

48 lines (40 loc) · 1.12 KB

(1)comment schemes in app/config/routing_prod.yml file

ex.

_main:
    resource: routing.yml
#    schemes: [http]

_main_custom:
    resource: project/routing_custom.yml
#    schemes: [http]

(2)add belllow line in web/app.php file

Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));

ex.

$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

(3)add belllow line in web/app_dev.php file

Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));

ex.

$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
Request::setTrustedProxies(array('127.0.0.1', $request->server->get('REMOTE_ADDR')));
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);