Forum Discussion

5 Replies

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    You could store the HTML in a file on the LTM, or you can simply embed the HTML in an iRule. The latter is the easier method. If you need images etc. on the page you could store those also, but it's a lot easier if they're hosted on a CDN or non-affected system.

     

    Another option is to host the page on a (set of) web server(s) and set up a pool/nodes for it.

     

  • currently this is for a development system that the client does not want everyone going to. So currently no systems we can mess with.

     

    If I understand the script when HTTP_REQUEST { if { ( [IP::addr [IP::client_addr] equals 10.1.1.1] ) or ( [IP::addr [IP::client_addr] equals 10.1.1.2] ) } { HTTP::redirect "http://10.200.200.200" } } When redirecting how would I point to the LTM

     

    Sorry not real familiar but thrown into this.

     

  • When the site owners don't want to redirect to an external site, we store an html file with embedded images/js in a datagroup in the F5. We get the content from the site owners, then gzip it, then b64encode it

    when LB_FAILED {
         Respond with sorry page
        HTTP::respond 503 Content [b64decode [class lookup "/sorry/sorry_prod.htm" dg_html_content]] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
    }
    

    I'm afraid clients which don't accept compression get an ugly response, however if you do want to cater for them and you have some content that is compressed and some that isn't;-

    set res [class lookup $sorry dg_html_content]    
    if {[HTTP::header Accept-Encoding] contains "gzip" && $res starts_with "H4sI"} {
        HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Content-Encoding "gzip" Connection "close"
    } else {
         They don't support gzip 
    HTTP::respond 503 content [b64decode $res] noserver Content-Type "text/html" Retry-After "600" Connection "close"
    }
    
    • Joe_5599_134300's avatar
      Joe_5599_134300
      Icon for Nimbostratus rankNimbostratus

      Simple maintenance page irule that includes the message in the irule. I was able to get this working on my lab box. Add to your VS then disable all pool members to test.

       

      when HTTP_REQUEST { if { [active_members [LB::server pool]] == 0 } { set http_reply "You have reached [HTTP::host],

       

       

      This site is currently under maintenance March 4th 10:00pm EST - March 5th 6:00am EST

       

       

      Please contact XYZ Corp Help Desk at 1-800-123-4567 if you continue to experience issues after this maintenance window. window." HTTP::respond 200 content $http_reply

       

      } }