Problem with WordPress behind Reverse Proxy
-
Things almost work – but not quite!
We are trying to run WordPress 5.3.2 behind a Reverse Proxy (hosted on Citrix Netscaler VPX appliances). We are wanting to do SSL offload – i.e. internally we are talking only to a RHEL server on Port 80.
We are doing a multisite installation and the canonical (internal) name is https://sites.massey.ac.nz, whereas the virtualised / Rev Proxy address is:
https://www.massey.ac.nz/sites2/
This is the block of code that I have added to the top of our wp-config.php
if ($_SERVER['HTTP_CS_VS'] == 'cs-vs-ssl-proxy') { /* Request is from Rev Proxy */ $_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_X_FORWARDED_FOR']; $_SERVER['HTTP_X_FORWARDED_SERVER'] = $_SERVER['HTTP_X_FORWARDED_FOR']; define('WP_HOME', 'https://www.massey.ac.nz/sites2'); define('WP_SITEURL', 'https://www.massey.ac.nz/sites2'); $_SERVER['REQUEST_URI'] = str_replace("wordpress", "sites2", $_SERVER['REQUEST_URI']); }
I would expect this to rewrite ALL URLs and almost all of the URLs are. But the problem is some resources are still coming through with the canonical (i.e. https://sites.massey.ac.nz URL – particularly some key components of WordPress. For example, in my Safari developer console:
[blocked] The page at https://www.massey.ac.nz/sites2/ was not allowed to run insecure content from https://sites.massey.ac.nz/wp-includes/js/wp-emoji-release.min.js?ver=5.3.2.
I’m not sure how to go about troubleshooting this. Could someone please help.
Here is a screenshot showing the problem. Please note the red box highlighted in the Safari Developer console:
Thanks in Advance,
Patrick
- This topic was modified 5 years, 1 month ago by .
- This topic was modified 5 years, 1 month ago by .
- This topic was modified 5 years, 1 month ago by .
The page I need help with: [log in to see the link]
- The topic ‘Problem with WordPress behind Reverse Proxy’ is closed to new replies.