Wordpress & Django -- One domain, two servers. Possible?
My question is about hosting Django and Wordpress under one domain, but two physical machines (actually, they are VMs but same diff).
Let's say I have a Django webapp at example.com. I'd like to start a Wordpress blog about my webapp, so any blog page rank mojo flows back to my webapp, I'd like the blog address t be example.com/blog. My understanding is blog.example.com would not transfer said page rank mojo.
开发者_Python百科Because I'm worried about Wordpress security flaws compromising my Django webapp, I want to host Django and Wordpress on two physically separate machines.
Given all that, is it possible using re-write rules or a reverse proxy server to do this? I know the easy way is to make my Wordpress blog a subdomain, but I really don't want to do that.
Has anyone done this in the past, is it stable? If I need a third server to be a dedicated reverse proxy, that's totally fine.
Thanks!
You can do this with haproxy -- a robust software load balancer:
global
user haproxy
group haproxy
# chroot /usr/share/haproxy
pidfile /var/run/haproxy.pid
daemon
log 127.0.0.1 local0 info
defaults
log global
mode http
option httplog
option dontlognull
option redispatch
option httpclose
option forwardfor
balance roundrobin
retries 3
contimeout 5000
clitimeout 600000
srvtimeout 600000
frontend http_proxy :80
acl path_foo path_beg /foo
use_backend foo if path_foo
default_backend www
backend foo
server foo0 127.0.0.1:8080
backend www
server www0 127.0.0.1:8081
精彩评论