Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been futzing around with getting this set up however I don't know if Varnish supports what I am trying to do:

  1. I have a server (ec2) thats running Nginx/Magento for ecommerce (www.domain/)
  2. On the same server, in a subdirectory of Magento, I am running Wordpress (www.domain/blog/)

Both of these are being fronted by an instance of Varnish and things are happy(tm), however, for monitoring and performance reasons I want to move the Wordpress instance off onto its own server and then point Varnish at that server for blog requests while keeping it pointed at the existing Nginx/Magento for ecommerce.

I have already tried having my sysadmin set this up using the example VCL files from Varnish but there were issues w/ requests for Magento that Varnish was sending over to Wordpress which then showed up as 404s.

Do I just need to work out a properly configured VCL file? Am I missing anything else? Does anyone have a working example of a VCL file that does this?

share|improve this question

closed as not a real question by mgorven, mdpc, Khaled, Scott Pack, Ward Feb 3 '13 at 6:30

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

Just redirect the traffic to different backend based on that specific URI

backend wordpress {
  .host = "my.other.server.ip";
  .port = "80";

sub vcl_recv {
  if (req.url ~ "^/blog" && req.http.Host ~ "(.*)") {
    set req.backend = wordpress;
share|improve this answer
Yep--just what I thought it was and THANK YOU for the subroutine! – Matthew Feb 5 '13 at 8:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.