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

Filippo Pisano filippo.pisano at gmail.com
Wed Jul 23 22:21:51 UTC 2014


The solution provided by Mike is way more robust than replacing
strings/urls at the WordPress level.
Thank you for sharing it.



Filippo Pisano
cel: 3291821355 / skype: filippopisano


On Thu, Jul 24, 2014 at 12:00 AM, Mike Little <wordpress at zed1.com> wrote:

> 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
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list