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
Try this:
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
}
}
The above is not working, kindlu suggest how can we make thiswork.
So, you mean manually we need to add the same apology-server into the same pool with the aplication servers and apply the maintainence-IRULE ?
Can you suggest pointing using the Maintainence-Pool
What error message are you receiving?
nitass
November 4, 2014, 7:14am
6
you want to respond maintenance page when server returns 4xx code, don’t you?
if yes, is example in HTTP::retry wiki helpful?
HTTP::retry
Hello Parveez,
basically you cannot select a pool based on a server response code like Status, as you have already forwarded you connection to a pool and received the response, you are done with the load balancing part.
you can either select one of the option community sent you before, using retry irule or directly send the redirect page. Alternative would be to create a maintenance pool virtual server and using the redirection to that one.
Hi All,
Sorry for confusing all.
Kindly allow me to explain one more time:
We have one Internal Apology application-server(serving the Apology-Page) which can be accessible via http://xyz.gems.com:88/apologies/apologies.htm
Apology application-server xyz.gems.com:88 is binded into a Pool named Maintainence-Pool.
How can I write an Irule calling the Maintainence-Pool and which includes /apologies/apologies.htm as the Apology application-server contains extension as /apologies/apologies.htm(as mentioned above).
My idea is to add that single Irule to all my environments and it should work. Kindly guide me please, struck into this.
Thanks and Regards PZ
Use HTTP::uri to set the destination uri and pool To sélect your maintenance pool
Hi Arnaud,
Extremely sorry Sir, basically new to this, can you please assist me in editing or writing the same for me, I will keep the same as a reference to understand the Irules.
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
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
nitass
December 14, 2014, 3:24am
15
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
---------------------------------------------------------------