I'm migrating legacy apps to docker and I need to "trick" php into thinking that it runs on the exact same environment as it used before.
Basically, the app used to run on an apache2 with mod_php and the PHP code does something somewhere that says "If you've been called with HTTP, set the link for the images to http."
My docker image is now accessible locally with http only. But I would like to still fake PHP into thinking that it has been accessed with HTTPS.
I suppose that Apache should rewrite the $_SERVER['HTTPS']
variable but I can't find in the documentation how I could do that.
Here is my current configuration for my app:
<VirtualHost *:8080>
DocumentRoot "/var/www/app"
<Directory /var/www/app>
Require all granted
Order allow,deny
Allow from all
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
question from:
https://stackoverflow.com/questions/65886245/trick-php-running-behind-mod-php-and-change-host-and-protocol 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…