I have a Symfony 2 website that either runs on HTTP in development or on HTTPS in production.
I noticed that in production the URL's generated by Symfony are still all rendered as HTTP.
How can I either;
Assuming this case :
REMOTE_ADDR
(i.e with mod_rpaf
apache extension) (of course in this case you can't use trusted_proxies
value)You can set HTTPS environment variable in your webserver, indexed on X-FORWARDED-PROTO header value, to force Symfony to use https protocol.
In Apache :
SetEnvIf x-forwarded-proto https HTTPS=on
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With