LTM iRule recursive redirect
Hi I have virtual server configuration with : irule policy
Policy create select pool when you give a name for example: virtual server IP: 10.10.10.1 CNAME: app1.example.com to 10.10.10.1
For context(uri) i use data group file REDIRECTS with data: app1:=/app1 When you wrote in browser : irule redirect to https://app1.example.com/app1, but if it's only root context (/) then redirect to / location.
when HTTP_REQUEST {
set HostName [getfield [HTTP::host] "." 1 ]
if { [HTTP::uri] equals "/" } {
set uri [class lookup ${HostName} REDIRECTS]
if { ${uri} ne "" } {
HTTP::respond 301 noserver Location "${uri}" Connection Close
} else {
HTTP::respond 301 noserver Location "https://${HostName}[HTTP::uri]" Conection Close
}
event disable all
TCP::close
return
}
}
For some reaseon when application have only root context, when I am checking with curl command I have error: * Maximum (50) redirects followed curl: (47) Maximum (50) redirects followed
I run tcpdump and from server side I see, that server response ith page, but I have only in browser illegal redirect. I think it's something with iRule, but I don't know what. Could someone help me with this issue
Regards