Wordpress & Django - one domain, two servers. Possible?

My question is about placing Django and Wordpress under the same domain, but two physical machines (actually these are virtual machines, but the same differences).

Let's say I have a Django webapp on example.com. I would like to start a Wordpress blog about my webapp, so that any mojo blog page rank returns to my webapp, I would like the blog address to be example.com/blog. My understanding is blog.example.com will not pass the specified mojo page rank.

Since I worry about Wordpress security flaws compromising my Django webapp, I want to host Django and Wordpress on two physically separate machines.

Given all this, is it possible to use this with rewrite rules or a reverse proxy? I know that an easy way is to make my Wordpress blog a subdomain, but I really don't want to.

Has anyone done this in the past, is it stable? If I need a third server that will be a dedicated reverse proxy, this is completely normal.

Thank!

+3
source share
1 answer

You can do this with haproxy, a reliable 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
+5
source

Source: https://habr.com/ru/post/1785252/


All Articles