Forum Discussion
Kalpesh_48932
Feb 13, 2012Nimbostratus
Http_referrer in iRule
Can anyone tell me how to use HTTP_Referrer in iRule...?
I have my current rule is
when HTTP_REQUEST { if {[active_members [LB:erver pool]] < 1} { HTTP::redirect "http://dev-sorry-webarch.xyz.com" } }
and is working fine for re-direction..but I need to use HTTP_Referrer in it..
- hooleylistCirrostratusHi Kalpesh,
- Kalpesh_48932NimbostratusHI Hoolio,
- nitassEmployeePlease tell me if i can use HTTP_Referrer in above iRulewhat do you want to do??
- nitassEmployeeI have to use HTTP_referrer in it..........., i would like to have as http_referrer (which is used for that : http://en.wikipedia.org/wiki/HTTP_referer) wth the original DNS calledoh, this is what you want, isn't this?
- hooleylistCirrostratusAn HTTP user agent will likely ignore a Referer header that the server sets in a response. The client is responsible for setting the Referer header based on the URL which generated the request. See RFC2616 for details on this (or the wikipedia link Nitass linked to).
- Kalpesh_48932NimbostratusI would like to call HTTP_refered header of one of the link to the another one after redirection...
- nitassEmployeeI would like to call HTTP_refered header of one of the link to the another one after redirection...sorry i could not catch you. can you show us an example?
- Kalpesh_48932Nimbostratus•When a user reaches the VIP via http://dns1.com for which application is down, he must be redirected to http://dns2.com
- Kalpesh_48932Nimbostratus"sorry i could not catch you. can you show us an example?"
- nitassEmployeei do not think HTTP Referer is applicable.
[root@ve1023:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.19.79:80 ip protocol 6 rules myrule profiles { http {} tcp {} } } [root@ve1023:Active] config b pool foo list pool foo { monitor all fake members 200.200.200.101:80 {} } [root@ve1023:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1}{ HTTP::redirect "http://dns2.com/?origin=http://[HTTP::host][HTTP::uri]" } } } [root@ve1023:Active] config b pool foo|grep -i pool\ member +-> POOL MEMBER foo/200.200.200.101:80 inactive,down [root@ve1023:Active] config curl -I http://dns1.com/whatever HTTP/1.0 302 Found Location: http://dns2.com/?origin=http://dns1.com/whatever Server: BigIP Connection: Keep-Alive Content-Length: 0
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