from the $_SERVER php array:
$_SERVER['APP_ENV'] prod
$_SERVER['APP_DEBUG'] 0
$_SERVER['TRUSTED_PROXIES'] 172.16.0.0/12
$_SERVER['HTTP_X_FORWARDED_FOR'] XXX.XXX.XXX.XXX
$_SERVER['HTTP_X_FORWARDED_HOST'] my.website.com
$_SERVER['HTTP_X_FORWARDED_PORT'] 443
$_SERVER['HTTP_X_FORWARDED_PROTO'] https
from the HTTP Headers:
X-Forwarded-For XXX.XXX.XXX.XXX
X-Forwarded-Host my.website.com
X-Forwarded-Port 443
X-Forwarded-Proto https
in src/public/index.php
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
in /src/Controller/TestController.php
class TestController
{
public function index(Request $request)
{
$response = new Response();
$response->setContent( $request->getScheme() );
return $response;
}
}
output
http
but the expected output is
https
why symfony return the wrong http scheme?