What's up! I am trying to install WordPress docker over HTTPS only. It works but fails to load the static images and javascript since the browser does not let them be loaded over plain HTTP. How can I switch them to be loaded over HTTPS also? My Dockerfile looks like this:
FROM wordpress:5.3.2-apache
EXPOSE 80
USER root
The SSL termination happens in traefik and all HTTP requests are redirected to HTTPS
Please take a look at the below image.
The installation is done successfully and after installation, I do the following to make everything load over HTTPS. How can I do the same but BEFORE installation?
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}