heskez_36146
Nov 19, 2013Nimbostratus
irule maintanance with redirection produces error
This is the situation:
We've following maintanance Irule (with your help much appreciated):
when HTTP_REQUEST {
switch [HTTP::uri] {
"/index.css" {
HTTP::respond 200 content [ifile get index.css] "Content-Type" "text/css"
}
"/logo.gif" {
HTTP::respond 200 content [ifile get logo.gif] "Content-Type" "image/gif"
}
default {
HTTP::respond 200 content [ifile get error.html] "Content-Type" "text/html"
}
}
}
This matches our expectations on following url:
"https://www.y.com/GoSouth" "https://www.y.com/GoWest" Now we want to apply redirection and show the maintanance as well.
We apply redirection on following url:
With following irule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"*gosouth*" {
add the redirect link ie "www.xyz.com"
HTTP::redirect "https://www.y.com/GoSouth"
}
default {
add the default action you prefer ie "www.def.com"
HTTP::redirect "https://www.y.com/GoWest"
}
}
}
We applied the redirection irule on the www.x.com
Redirection works but doesn't show the images.So we made a change in the redirection irule:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"*gosouth*" {
add the redirect link ie "www.xyz.com"
HTTP::redirect "https://www.y.com/GoSouth"
}
default {
add the default action you prefer ie "www.def.com"
HTTP::redirect "https://www.y.com/"
}
}
}
Now the images of the maintanance pages are visible on url:
"https://www.y.com/GoSouth" "https://www.y.com/GoWest"
But when we go to https://www.x.com -> redirected to https://www.y.com we get an "connection reset" error in the browser.
Any idea what's causing this? and which irule is responsible?