Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have an existing web application at www.example.com. The marketing team has a hosted Drupal instance at marketing.example.com. Is there a reverse-proxy solution that would allow me to serve up the marketing content from www.example.com/marketing?

I would like to do this with networking infrastructure changes only; ie NOT changing either the marketing site base url configuration, or adding code to www.example.com.

In Varnish, I can do something like:

if (req.url ~ "^/marketing/") {
  set req.host = "marketing.example.com";
  set req.url = regsub(req.url, "^/marketing/", "/");
} 

However, marketing.example.com is serving up HTML with absolute links like "/blog", that now need to be updated to "/marketing/blog". Could the reverse proxy re-write these links, but keep asking the marketing backend for "/blog"?

Again, I don't want to change the configuration of the marketing site to respond to the new URL format itself. I want the reverse proxy to handle all that.

Right now we're using Varnish, but I'm open to other solutions.

share|improve this question

1 Answer 1

Varnish can not touch and rewrite the contents being served (only the headers). Maybe the latest and greatest version (3.x) can do it with some VMOD, but I doubt that.

Maybe a setup like the Upside-Down-Ternet (http://www.ex-parrot.com/~pete/upside-down-ternet.html) with squid will help you, what kind of performance are you looking at?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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