Forum Discussion

Kapil_Sharma_61's avatar
Kapil_Sharma_61
Icon for Nimbostratus rankNimbostratus
Sep 13, 2005

HTTP rewrite without redirecting (kind of reverse proxy)

Hi,

 

I have a pool of 3 servers. The following are the details:

 

 

server 1

 

server 2

 

server 3

 

 

I want to create an irule which send all user requests to

 

1: server1 if it is up.

 

2: server2 if server 1 is down

 

3: server3 if server 2 is down

 

 

I have got this working but when the server 1 is down, I want to rewite the incoming url from the client and send it to the backend server. I also need to check the status of the pool members inside the irule and only process the following rule if server1 is down.

 

 

Client sends a URL:

 

https://www.foo.com/signin.jsp?data=dadasdasdadas

 

 

here data=dadasdasdadas is the encypted query string.

 

 

The BigIP should rewrite the above URL and send it to the backened server as follows:

 

 

"http://server2:9000/cgi/xxxx/foo-eng.exe/FFF/system/default/user/login/app/home/html"

 

The query string that starts with "data=dadasdasdadas" should be intact and sent to the backend server.

 

 

All output to the end users must not show any of the backend server's ip/URL.

 

 

Thanks,

 

Kapil

 

 

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    Rather than check pool member status in the rule, I would use priority member LB to handle the load-balancing part. For example:

    
    pool www_pool {
       min active members 1
       member 10.1.1.1:http priority 100
       member 10.1.1.2:http priority 90
       member 10.1.1.3:http priority 80
       member 10.1.1.4:http priority 70
       member 10.1.1.5:http priority 60
    }

    This ensures that server1 will be picked if it's up. If it's down, server2 will be picked. If server2 is down, server3 will be picked, and so on.

    As for the URL rewriting, you should be able to do that in an LB_SELECTED rule. You can use the "LB::server addr" command to determine which server was picked and the "HTTP::uri" command to rewrite the URL. Good luck!