Can you have a blog in a subdirectory hosted on a different server?

I am interested in having a blog on my site which will be in a subdirectory of the main wordpress homepage

e.g. website.com/blog

however, I am interested to know if there is a way to host the blog on a separate server – primarily because I don’t want to overload the server for the rest of the site if there is a lot of traffic going to the blog. I am keen on the idea of it being a subdirectory though.

Anyway – just thought there would be someone smarter than me who might have a bright idea 🙂

3 s
3

A reverse proxy could work, such as varnish or nginx. Using varnish as an example:

backend blog {
   .host = "blog-server-ip";
}

backend default {
   .host = "current-domain-ip";
}

sub vcl_recv {
   if (req.rul ~ "^/blog/") {
      req.backend = blog;
   }
}

Leave a Comment