开发者

Bitnami Wordpress with Google Cloud Load Balancer

开发者 https://www.devze.com 2022-12-07 20:11 出处:网络
My setup is Bitnami WordPress and Google Cloud Load Balancer. I\'ve encountered a few issues. To use a load balancer with Bitnami WordPress, I\'ve to use this

My setup is Bitnami WordPress and Google Cloud Load Balancer. I've encountered a few issues.

To use a load balancer with Bitnami WordPress, I've to use this

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

That allows the VM to be accessible by both IP and domain. The problem is Google is indexing the VM's IP and some plugins are using the VM's IP too.

Neither can I use HTTPS because the SSL is handle开发者_StackOverflow社区d by the Load Balancer. That causes mixed content issues on some pages when some plugins are used. Adding X-Forwarded-Proto doesn't work.

The website will break if I use any other configuration other than

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

I wonder if it is because of my configuration error or is the native behaviour of Bitnami WordPress.

0

精彩评论

暂无评论...
验证码 换一张
取 消