Forum Discussion
HTTP 404 ERROR HANDLING through IRULE
Hi Jason Rahm ,
I have re-written my irule using some variable for flexible matching :
Here is irule that i am using :
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [HTTP::uri]
if {$host equals "xyz.apac.com."} {
set context [getfield $uri "/" 2]
if {($context ne "archiacserver") and ($context ne "archiacportal") and ($context ne "archiac")} {
HTTP::respond 404 content {Page Not Found Page Not Found}
} elseif { ($uri starts_with "/archiacserver")} {
HTTP::uri [string map {"/archiacserver" "/archiac"} [HTTP::uri]
HTTP::redirect "https://$host[HTTP::uri]"
pool PL_BNE_ENT_6443
return
} elseif {$uri starts_with "/archiac"} {
pool PL_BNE_ENT_6443
}elseif {$uri starts_with "/archiacportal"} {
pool PL_BNE_ENT_archiacportal_443
return
}
}
}
SO below are GOOD matching :
www.xyz.apac.com/archiacserver
www.xyz.apac.com/archiacserver/
www.xyz.apac.com/archiacserver/abcde/efgh
www.xyz.apac.com/archiacportal
BAD MATCH
www.xyz.apac.com/dhghasgharchiacserver
www.xyz.apac.com/ARCHIACSERVER
www.xyz.apac.com/archiacserveradjefjaehfje
www.xyz.apac.com/archiacserver)*)*)*)*)*)
www.xyz.apac.com/archiacPORTAL
www.xyz.apac.com/ARCCHIACPORTALjdfbjdsfjasd
etc etc
SO my code work fine with testing and loading the APP through LB and also now looks like error handling works fine . . But i am seeing some issues with session kick out .
For example if i try to load www.xyz.apac.com/archiacserver/admin/login , this works fine .Page load up with username and password and work perfectly .
But if i hover to some tab after logged in and click , the session times out and ask for a re-login .
we are not doing any Load balancing , simply sending the traffic to pool and my pool is configured with ACTIVE/STANDBY nodes using priority group .< 1 with one node being on 10 and other on 5 .
So no cookie persistence needed .
ANy suggestions ?? something wrong with my irule ?
No session kick out when i hit the node directly .
Thanks
If you are trying to match the path and NOT the query parameters, you'd be better off using HTTP::path, which only includes path information for that instead of HTTP::uri, which includes both path and query parameters.
For your badmatch, are you saying those are still matching, or that they are no longer matching?
finally, are you seeing any tcl errors in the logs when the sessions are being "kicked out"?
FYI, I'm going to be out on PTO for the next few days
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com