Forum Discussion

Parveez_70209's avatar
Parveez_70209
Icon for Nimbostratus rankNimbostratus
Oct 31, 2014

Issue facing in Maintainence Page

10.25.133.24:88 is the maintainence page server and we are binding it inside named: maintenance-Pool

 

Our Irule is not working when attached:

 

when HTTP_REQUEST { set host [HTTP::host] } when HTTP_RESPONSE { if { [HTTP::status] eq "404" } { HTTP::redirect http://$host/apologies/apologies.htm pool Maintenance-Pool return } elseif { [HTTP::status] eq "400" } { HTTP::redirect http://$host/apologies/apologies.htm pool Maintenance-Pool return } }

 

Thanks and Regards PZ

 

14 Replies

  • Hi,

     

    So are you saying to use the below Irule plus I believe we need to keep the apology-server into the same Pool right as per our design ? which I explained into my previous post ?

     

    when HTTP_REQUEST priority 200 { set host [HTTP::host] } when HTTP_RESPONSE priority 200 { if {[HTTP::status] == 404} { HTTP::redirect http://$host/apologies/apologies.htm return } elseif {[HTTP::status] == 400} { HTTP::redirect http://$host/apologies/apologies.htm return } }

     

    Thanks and Regards PZ

     

  • Hi,

     

    So are you saying to use the below Irule plus I believe we need to keep the apology-server into the same Pool right as per our design ? which I explained into my previous post ?

     

    when HTTP_REQUEST priority 200 { set host [HTTP::host] } when HTTP_RESPONSE priority 200 { if {[HTTP::status] == 404} { HTTP::redirect http://$host/apologies/apologies.htm return } elseif {[HTTP::status] == 400} { HTTP::redirect http://$host/apologies/apologies.htm return } }

     

    Thanks and Regards PZ

     

  • e.g.

     configuration
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:80
        ip-protocol tcp
        mask 255.255.255.255
        pool foo
        profiles {
            http { }
            tcp { }
        }
        rules {
            qux
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 9
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
    ltm pool foo {
        members {
            200.200.200.101:80 {
                address 200.200.200.101
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool maintpool
    ltm pool maintpool {
        members {
            200.200.200.111:88 {
                address 200.200.200.111
            }
        }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
    ltm rule qux {
        when RULE_INIT {
      set static::mainthost "xyz.gems.com:88"
      set static::maintreq "GET /apologies/apologies.htm HTTP/1.1\r\nHost: ${static::mainthost}\r\nConnection: Close\r\n\r\n"
    }
    when HTTP_REQUEST {
      if { [HTTP::host] equals $static::mainthost } {
        set is_maint 1
        pool maintpool
      } else {
        set is_maint 0
      }
    }
    when HTTP_RESPONSE {
      if { not($is_maint) and [HTTP::status] starts_with "4" } {
        HTTP::retry $static::maintreq
      }
    }
    }
    
     trace
    
    [root@ve11a:Active:In Sync] config  ssldump -Aed -nni 0.0 port 80 or port 88
    New TCP connection 1: 172.28.24.1(57099) <-> 172.28.24.10(80)
    1418530911.5045 (0.0025)  C>S
    ---------------------------------------------------------------
    HEAD /abc123 HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Host: 172.28.24.10
    Accept: */*
    
    ---------------------------------------------------------------
    
    New TCP connection 2: 200.200.200.14(57099) <-> 200.200.200.101(80)
    1418530911.5056 (0.0009)  C>S
    ---------------------------------------------------------------
    HEAD /abc123 HTTP/1.1
    User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Host: 172.28.24.10
    Accept: */*
    
    ---------------------------------------------------------------
    
    1418530911.5075 (0.0019)  S>C
    ---------------------------------------------------------------
    HTTP/1.1 404 Not Found
    Date: Sun, 14 Dec 2014 04:06:23 GMT
    Server: Apache/2.2.3 (CentOS)
    Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
    ETag: "41879c-59-2a9c23c0"
    Accept-Ranges: bytes
    Content-Length: 89
    Content-Type: text/html; charset=UTF-8
    
    ---------------------------------------------------------------
    
    2    1418530911.5075 (0.0000)  C>S  TCP FIN
    2    1418530911.5090 (0.0015)  S>C  TCP FIN
    New TCP connection 3: 200.200.200.14(57099) <-> 200.200.200.111(88)
    1418530911.5091 (0.0015)  C>S
    ---------------------------------------------------------------
    GET /apologies/apologies.htm HTTP/1.1
    Host: xyz.gems.com:88
    Connection: Close
    
    ---------------------------------------------------------------