[wp-hackers] WordPress, load balancer and domain names

Mike Little wordpress at zed1.com
Wed Jul 23 22:00:57 UTC 2014


Anything you do in WordPress to resolve this issue is probably too slow.
I'm assuming a very busy site if you need to load balance two front end
servers.

I've done this before (or at least generating content on one url and
serving it on another) with apache proxying:

backend cms server: cms.example.com all content is written at that url.
front end server 1 server1.example.com uses mod_proxy and mod_substitute to
convert everything to public facing address.
front end server 2 server2.example.com uses mod_proxy and mod_substitute to
convert everything to public facing address.

e.g in the vhost setting
#make sure to translate all content types that may have urls in it
AddOutputFilterByType SUBSTITUTE text/html
AddOutputFilterByType SUBSTITUTE application/atom+xml
AddOutputFilterByType SUBSTITUTE application/xhtml+xml
AddOutputFilterByType SUBSTITUTE application/xml
AddOutputFilterByType SUBSTITUTE text/xml
AddOutputFilterByType SUBSTITUTE text/plain
AddOutputFilterByType SUBSTITUTE text/css
AddOutputFilterByType SUBSTITUTE text/javascript

Substitute s/cms.example.com/example.com/n

#proxy in and out
ProxyPass           / http://cms.example.com/
ProxyPassReverse    / http://cms.example.com/

# turn this off: we can't substitute in gzipped content
RequestHeader    unset  Accept-Encoding

This is very approximately what I remember, you will need to tweak it. I'm
sure nginx has an equivalent.


Mike
-- 
Mike Little
*WordPress Specialist*

Web: mikelittle.org
Skype: mike.little.zed1
Twitter: @mikelittlezed1
LinkedIn: linkedin.com/in/mikelittle

Founder and Director
*Zed1.com Limited*
http://zed1.com/
Registered in England & Wales, no. 6745562


More information about the wp-hackers mailing list