Forum Discussion

Thanadon_Wattan's avatar
Thanadon_Wattan
Icon for Nimbostratus rankNimbostratus
Feb 24, 2005

Is it possible to use F5 as proxy/reverse proxy server?

I try to config F5 as proxy/reverse proxy by i-Rule.

 

 

is it possible?

 

 

I use data group for mapping request uri to internal server like this

 

 

{http://www.host1.com/path1/ http://10.10.0.15:83/}

 

 

and matching 1st field to HTTP::host and path

 

if it matches, I write 'node 2nd_field' to send the request to specific server (for reverse proxy function)

 

 

 

and if I have many lines of mapping, this may degrade the performance of F5?

 

 

and should I use F5 as reverse proxy?

 

 

coz I need the High Availability proxy server and don't want to pay for 2 servers and a pair of F5 to make it. so I choose to add proxy function to F5 instead.

 

 

Thank you in advance.

6 Replies

  • Also see this thread: http://devcentral.f5.com/default.aspx?tabid=28&forumid=5&postid=1514&view=topic on constructing a uri.

     

     

    Let me know if you need help.

     

     

    -Brian
  • I need some help. I'm new in i-Rule configuration and tcl script.

     

     

    I have 2 external data groups : host_map and crp_map

     

     

    in host_map have this content:-

     

    "crp.domainname.com crp_map"

     

     

    and in crp_map have this content :-

     

    "/ /index.jsp CRP_Pool"

     

     

     

    First I want to map HTTP::host to crp.domainname.com if it equals

     

    I want to use i-Rule to check in another datagroup name "crp_map" that writen after the host like this

     

     

     

    set loop 0

     

    set max [llength $::host_map]

     

    while {$loop < $max} {

     

    set tmpstr [lindex $::host_map $loop]

     

    scan "%s%s" $tmpstr host data

     

    if {[HTTP::host] == $host} {

     

    <<>>

     

     

    I try to set like :

     

     

    $::$datagroup

     

    $"::$datagroup"

     

    $::{$datagroup}

     

     

    and many ways. but it didn't work.

     

     

    anyone can help me? or know another way to refer to datagroup than $::

     

     

    thank you.
  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    I am not entirely sure what you are trying to do. But you seem to be using TCL lists and I think you are trying to perform double variable expansion. Perhaps this example will help:

     
     % set foo { 1 2 3 4 } 
      1 2 3 4 
     % puts [lindex $foo 3] 
     4 
     % set bar foo 
     foo 
     % puts [lindex [subst $$bar] 3] 
     4 
     

    You also might consider using the foreach command to iterate over all the elements of the list instead of the while command.
  • thank you for quick answer.

     

    I think your answer is work. but I have another problem when I write like you comment. May you help me again?

     

     

    set loopidx1 0

     

    set maxloop1 [llength $::host_map]

     

    log $maxloop1

     

    while { $loopidx1 < $maxloop1 } {

     

    set tmpstr1 [lindex $::host_map $loopidx1]

     

    scan $tmpstr1 "%s%s" hosturl datagroup

     

    if { ($request_host == $hosturl) } {

     

    set loopidx2 0

     

    set datagroup ::$datagroup

     

    log [subst $$datagroup]

     

    log [lindex [subst $$datagroup] end]

     

     

    and when I try to connect to server it errors like this;

     

     

    Feb 25 16:02:10 tmm tmm[11654]: 01220002:6: Rule CRP_Forward_rule : 4

     

    Feb 25 16:02:10 tmm tmm[11654]: 01220002:6: Rule CRP_Forward_rule : {/ /reg/index.jsp10 Exist_revprox} {/wap/ /wap/ Mobile_life}

     

    Feb 25 16:02:10 tmm tmm[11654]: 01220001:3: TCL error: Rule CRP_Forward_rule - list element in braces followed by "" instead of space while executing "lindex [subst $$datagroup] end"

     

     

    the error happend same as previous question I post here.

     

    do you have any comment? what should I do?

     

     

    thank you again.
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    You are very close. Try this:

     
     set group ::datagroup 
     log [subst $$group] 
     log [lindex [subst $$group] end] 
     

    You had an extra $ in the variable of the datagroup.

    I would also suggest you simply modify your host_map to contain the :: for the group name so you don't have to add the extra variable set command.