Destroyed Fixing Wordpress "Mixed content" or "CSP header" errors (markdown)

Marcel 2023-06-03 10:14:52 +02:00
parent c94883fb1f
commit b94eb6f8d2

@ -1,50 +0,0 @@
You already have a running Wordpress site with HTTPS and now it looks messed up since you use Zoraxy?
Then here is a solution for you!
Now your site looks like this with Zoraxy:
![wp1](https://github.com/tobychui/zoraxy/assets/110860055/09900779-0845-4c00-8fe7-5451f7775176)
Adminpanel
Let´s fix this! We need to edit the wp-config.php file as root user.
Switch to root:
`sudo su`
The file is located at the Wordpressweb root (/var/www/html/wordpress).
`cd /var/www/html/wordpress`
Sidenote:
If you use Wordpress in Docker and you used the standard example the file should located at /var/lib/docker/volumes/wordpress_wordpress/_data/wp-config.php
Open the wp-config.php with nano editor
`nano wp-config.php`
Put in these lines after the "<?php" part of the file
`if ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) { $_SERVER['HTTPS'] = 'on'; }`
![addedlines](https://github.com/tobychui/zoraxy/assets/110860055/b38051de-a61a-4d29-aa7e-78c1c47b8652)
That´s it!
Save the file with **CTRL + O** and leave nano with **CTRL + X**
Reload your page!
![finished](https://github.com/tobychui/zoraxy/assets/110860055/8d433ac8-a5ff-4638-a105-e59f4b2151a1)
Adminpanel
Leave the root shell with
`exit`
You are done :)
Tested with Wordpress and Apache on a hostinstallation and Wordpress in Docker (wordpress:latest) with existing sites.