Hi,
I’ve got an odd problem. On a site with multiple templates that all use <base href="[(site_url)]" />, one template (the main one) just won’t expand the placeholder with the site host name. The placeholder is just replaced with ’http:///’.
It’s really odd. If i check phpinfo on the server, $_SERVER[’HTTP_HOST’] is set correctly.
I’m racking my brains on this one. Anyone any ideas? I don’t want to just hard-code the host name or it’ll mess up testing and development, plus I can’t see any reason why it shouldn’t work...
Cheers
i’ve fixed this. i don’t know why it was happening, but it was only happening on the front page of the site. very odd...
-
MODX Staff
- 10,725 Posts
redman:
Did you change anything? Also, what version of MODx are we discussing and what is the Apache/PHP/MySQL configuration? I’ve experienced something similar in some rare situations and am wondering if you adjusted anything at all before it went away. It seems to happen sometimes after refreshing the cache, as if the first access to that page is coming from a client that is not setting the http_host to the proper value, but I could never confirm this.
-
MODX Staff
- 10,725 Posts
This sounds like a load-balancing issue (since you PM’d me that it was in a load balancing configuration). Can you tell me how the load-balancing is configured?
it’s just set up using a round-robin algorithm. Nothing that special...
Round robin just means that traffic is passed around all the hosts equally. The load balancer doesn’t attempt to determine the actual load on servers before sending traffic to it, so if one particular request causes a high load on a server, the load balancer won’t send more traffic to other servers until it recovers. It’ll just keep on distributing traffic equally to all servers.
I don’t have any documentation on the actual load balancer we’re using...
-
MODX Staff
- 10,725 Posts
Well, until I know what software/hardware configuration is being used to handle the load balancing, it’s gonna be difficult to determine the problem. I’ll try and start an in-depth investigation with the admin of the servers we have in a similar configuration.
-
MODX Staff
- 12,272 Posts
Round robin load balancing can be done simply with DNS A-Record entries, so there may be no real HW involved. DNS Made Easy works this way in conjunction with EC2, for example (would be public IPs of course):
mysite.com A 192.168.10.1
mysite.com A 192.168.10.2
mysite.com A 192.168.10.3
mysite.com A 192.168.10.4
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me