Forum Discussion
Ray_Rakib
Nimbostratus
Sep 25, 2019HTTP Header Insertion using LTM
Hi All, I have created an iRule to do HTTP header insertion, as I need to do this to restrict tenant access to Ms Office 365 for our internal users. My understanding is that I need t...
dennypayne
Employee
Jul 14, 2008Got it, so what I'm asking is how would they have accomplished this without the VIP? Is there a link to www.newapp.com somewhere that would be structured with /newapp/newapp.html? If so then the VIP doesn't need to do anything. Or are they expecting that now that the LTM is in play, that someone can just type in www.newapp.com in the browser and get to /newapp/newapp.html?
What I'm trying to get at is that I don't always consider it good design philosophy to depend on LTM to do something that the app couldn't do by itself in the first place. That being said, if the they are expecting LTM to solve this issue, the rule should be fairly easy. Something like:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" }
HTTP::redirect "http://www.newapp.com/newapp.html"
}
}
(I just did that with no syntax checking so you'd need to double-check that)
So what that rule is saying is if a client makes a request where the only URI is the trailing slash (empty, in other words), then redirect them to the proper path. It will pass through any other URI's (so when the client comes back to the vip with /newapp.html or any other URI then they will just pass through). If you needed to redirect other URI's then the rule would need some more logic.
I would say that there would be negligible performance impact from this rule, since LTM is optimized to do this sort of thing. But it is going to have to inspect every request to the vip to determine if it needs to redirect or not, which is why I come back around to the design philosophy aspect of this that I mentioned earlier. If the app was designed such that it wasn't depending on LTM to solve the problem, you eliminate a potential performance issue. Just something to keep in mind going forward.
Hope that helps!
Denny
This is possible via iRule to send all the traffic log to F5 log folder/file but only disadvantage is will fill log file quickly if application is highly used. This can be checked via F5 CLI.
Add below statement in iRule.
log local0. "requested host path is : [HTTP::host][HTTP::uri]"
# cat ltm | grep 'abc.xxx.com'
Thanks
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects