Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
WordPress mixed content error
« previous
next »
Print
Pages: [
1
]
Author
Topic: WordPress mixed content error (Read 4876 times)
toomanylogins
Newbie
Posts: 20
Karma: 0
WordPress mixed content error
«
on:
June 09, 2021, 06:06:23 pm »
When using the nginx plugin for WordPress site where the certificate is served by nginx and the apache server running behind a proxy is using http WordPress gives a mixed content error. There are numerous examples of this on the Internet. The answer apparently is to include
proxy_set_header X-Forwarded-Proto https;
However not sure how to incorporate this in the settings.
Any idea
thanks
Paul
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: WordPress mixed content error
«
Reply #1 on:
June 09, 2021, 09:42:29 pm »
It should be already there. However the backend server should process it as well.
Note: nginx will forward what it gets (http or https)
https://github.com/opnsense/plugins/blob/master/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf#L165
Logged
toomanylogins
Newbie
Posts: 20
Karma: 0
Re: WordPress mixed content error
«
Reply #2 on:
June 10, 2021, 11:30:37 am »
Thanks for reply. This turned out to be a WordPress issue. For anybody with the same problem insert this code at the top of the wpconfig file
/** SSL */
define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
Logged
LarryP
Newbie
Posts: 1
Karma: 0
Re: WordPress mixed content error
«
Reply #3 on:
April 19, 2023, 04:45:26 am »
Thank you!
That was so helpful getting my WP site working.
Logged
Mikuro
Newbie
Posts: 1
Karma: 0
Re: WordPress mixed content error
«
Reply #4 on:
November 27, 2023, 10:28:55 am »
Another tip is to check out
custom cms vs wordpress
. Evaluate the factors mentioned here to determine which option aligns best with your needs and goals.
«
Last Edit: December 02, 2023, 04:34:38 pm by Mikuro
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
WordPress mixed content error