Forum Discussion

skravens_86061's avatar
skravens_86061
Icon for Nimbostratus rankNimbostratus
Jan 21, 2011

adding a redirect to a maintenance page HTML code

Can you place "another" redirect inside the HTML code of a Maintenace page? This page goes up when the servers are not available, then after 10 seconds or so it redirects to a different IP or server. Anyone have experience with this?

 

 

Thank you
  • This thread should help.

     

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/afv/topic/aft/1174470/aff/5/showtab/groupforums/Default.aspx

     

     

    The rule I posted holds the user at a page and then after X seconds, redirects them.
  • Chris,

    Below I have modified your redirect irule:

    The page that i am trying to URL that I am redirecting from onlt uses 8443, not 80. Will the irule below redirct any requests to qa-dognet.org over to the 192.168.XXX.X address after a 5 second error page? Also can I take the support.com fallback information out?

    
    <
    when HTTP_REQUEST {
            if { [TCP::local_port] eq "80"  } {
                persist source_addr 60
                HTTP::fallback http://support.com/
                set dtime 5
     Un-comment the next 3 lines for redirects and expand out with elseif's if needed 
                   if { [HTTP::host] == "www.qa-dognet.org" } {
                    HTTP::respond 200 content \
    " 
    \We are sorry, but the site you are looking for is temporarily out of service." "Content-Type" "text/html" 
                } else {
                pool DMX-POOL
     Un-comment the net line if using redirects            
               }
            }   elseif { [TCP::local_port] eq "8443"  } {
                HTTP::header insert "BPL-SSL" "On"
                pool DMX-POOL
            } else {
            set srvr [findclass [TCP::local_port] $::Individual_Servers " "]
            if { $srvr ne "" } {
               node $srvr 80
            }  else {
     Replace  with the default URL of the site
              HTTP::redirect ""
          }
       }  
    }

    Thanks again Chris!

  • The example I posted in the other thread was for a user with a fairly complicated iRule already setup. Can you help me understand the exact situation in which you'd like the redirect/holding page to be presented? Is it simply if there are no active members in your pool? If so, you'd like the maintenance page to hold the user for 10 seconds? After the 10 seconds, where would you like them to go?
  • Ok , We would like users to go to a dummy VS (HTTPS://dognet.org) which will have no active members in it (DMX-Pool), from there they will get the holding page 10secs, then get redirected to the 192.168.XXX.X address.

     

     

    Does that help?

     

     

     

    Thanks again
  • The rule below will check whether there are any active members in the DMX-Pool. If there are none, it'll redirect to http://192.168.xxx.x/ after holding the user at the maintenance page for 10 seconds.

    
    when HTTP_REQUEST {
       if { [active_members DMX-Pool] < 1 } {
             set dtime 6
             HTTP::respond 200 content \
             "Apology page\
              We are sorry, but the site you are looking for is temporarily out of service." "Content-Type" "text/html" 
               }
       }
    

  • Wow Dude, you must work with these F5s alot.

     

     

    Thanks for the quick response, will go try it out.