2

Basically, we have one external IP address, several servers internally and want to redirect to each internal server based on request URL. We do not want to install another piece of hardware to do this for us but we have a firewall running Linux that currently forwards to only one of the internal servers. Example of our setup can be seen here: http://img23.imageshack.us/img23/5469/drawing1br.jpg NOTE: domain.com does not point to this box nor would we like it to. Subdomains are pointed manually to our global IP address.

user41250
  • 23
  • 3

1 Answers1

2

You could use varnish for this, install it on your firewall and use a config with several backends. Something like:

    # a simple backend
    backend b1 {
            set backend.host = "10.1.2.100";
            set backend.port = "http";
    }
    backend b2 {
            set backend.host = "10.1.2.101";
            set backend.port = "http";
    }
    backend b3 {
            set backend.host = "10.1.2.102";
            set backend.port = "http";
    }

    sub vcl_recv {
        if (req.http.host ~ "^(www.)?example.com$") {
            set req.backend = b1;
         }

         if (req.http.host ~ "^(www.)?example.org$") {
            set req.backend = b2;
         }

         if (req.http.host ~ "^(www.)?example.net$") {
            set req.backend = b3;
         }
    }
rkthkr
  • 8,503
  • 26
  • 38