Forum Discussion

paul_fairclough's avatar
paul_fairclough
Icon for Nimbostratus rankNimbostratus
Sep 26, 2007

port redirect - server side

** SOLVED ** problem with other Irule

 

 

 

We need to allow an inbound port 80 request to the F5 vip. We then need to complete the connection to the backend server on port 8080. ( not url redirect )

 

 

Following irule was created with this in mind but doesn't provide the correct functionality ( doesn't redirect to port 8080 )

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] starts_with "www.sitea.com"} {

 

pool Apache_Pool

 

}

 

elseif { [HTTP::host] starts_with "www.siteb.com" } {

 

HTTP::header replace "Host" "www.siteb.com:8080"

 

}

 

}

 

 

 

Cheers

5 Replies

  • What about simplifying it a bit and use a pool with nodes on 8080? Create Apache_pool_8080 and add the nodes with port 8080 configured. BIG-IP will then just do port translation instead of iRule having to do a redirect or re-write of the URL.
  • I tried this with a basic irule referring the 2 different sites to the 2 pools like you suggested. The site running on 80 was ok, but the site running on 8080 did not work.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi Paul -

     

     

    2 sites...?

     

    You only mention 1 above

     

     

    Please provide more specifics as to what you need to accomplish, & I'm sure we can help you further.

     

     

    /deb
  • Hi deb

     

     

    I have 2 sites defined on a web server one running on port 80 one running on port 8080. Without having to add :8080 to my url I need the traffic for the 2 independent sites to be forwarded to the corresponding site on the backend server. If you need more info please let me know.

     

     

    paul

     

     

     

  • Have solved this problem...

     

     

    Not a problem with the irule above problem was caused by another irule having some unexpected behaviour on site header.