We have a symfony project deployed and working ok but now we want to enable https.
We created and enabled another virtualhost like this:
<VirtualHost *:443>
ServerName project.domain.net
DocumentRoot /home/user/dev/project/web
<Directory /home/user/dev/project/web>
AllowOverride All
Require all granted
</Directory>
# uncomment the following lines if you install assets as symlinks
# or run into problems when compiling LESS/Sass/CoffeScript assets
<Directory /home/user/dev/project>
Options FollowSymlinks
</Directory>
ErrorLog /var/log/apache2/project.test_error.log
CustomLog /var/log/apache2/project.test_access.log combined
SSLEngine on
SSLCertificateChainFile /ssl/cert.pem
SSLCertificateKeyFile /ssl/private.key
SSLCertificateFile /ssl/wildcard.crt
We can navigate to https://project.domain.net and it seems ok but when we check
$request->getUri();
the result is http://project.domain.net, so it is http instead of https.
Why is that? how to fix?
UPDATE: We added the config given by @Leroy and the result is:
HTTP_X_FORWARDED_PROTO https
REQUEST_METHOD GET
REQUEST_SCHEME http
SERVER_NAME zerbikatdesa.sare.gipuzkoa.net
SERVER_PORT 80
and the $request->getUri still returns the http insted of https