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.

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.

share|improve this question
2  
You want a reverse proxy. –  Kyle Brandt Apr 22 '10 at 18:18
add comment

1 Answer

up vote 1 down vote accepted

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;
         }
    }
share|improve this answer
    
Thanks. Now just to get the RPM to install on RedHat 7.3 with an outdated GLIBC... –  user41250 Apr 22 '10 at 20:36
    
@bculverscate - Red Hat 7.3? You're kidding... right? –  warren Apr 22 '10 at 21:59
    
RH 7.3 ouch! That is your first problem :) –  rkthkr Apr 23 '10 at 5:45
    
Sadly no, but it's an excuse to remap the network and spend a weekend with IP addresses. –  user41250 Apr 23 '10 at 14:24
add comment

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.