Reputation: 31
I've installed wordpress on my VPS a hundred times, this time the style/css is missing for some reason, the setup looks like this: https://image.prntscr.com/image/ETY6oXebR5aEAWI2lWSnAQ.png
If I proceed with the installation, the whole site will have it's style/css missing.
I've tried clearing out the directory and uploading a new wordpress setup file, but I get the same problem each time.
Anyone knows what could be the issue?
Upvotes: 0
Views: 4297
Reputation: 351
If you are behind a reverse proxy that does SSL/TLS for you, or in a similar situation, wordpress needs to know that this is the case (otherwise it will assume unencrypted http and will make all links to references unencrypted). If http gets redirected to https this can cause problems.
You can resolve this by configuring the webserver to add certain headers, e.g. for Nginx inside the server block, add:
location /blog/ {
proxy_pass http://backend:8081/;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
and in the wp-config.php (usually created after installation, so you'll have to do the install without styling):
/**
* Handle SSL reverse proxy
*/
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
I had the same problem and found this out here: https://www.variantweb.net/blog/wordpress-behind-an-nginx-ssl-reverse-proxy/
Upvotes: 9
Reputation: 31
Okay the problem was that this domain had forced SSL on it. So via https the installation wasn't working properly. I disabled SSL and it works fine now.
Upvotes: 0