Forum Discussion
Can you please provide an example in irules where I reference the HTTP_REFERRER to block access from certain sites?
Typically HTTP_REFERRER is not past on public sites, but I have some non production websites where I can add this header and I want to ensure when going to production site if I get a referrer from non-production website it is blocked.
1 Reply
- Philippe_CLOUP
Employee
Hi Carpenteiro, HTTP referer is not an EVENT in iRule language, because it is an HTTP Header in HTTP Protocol. when we write HTTP_XYZ in iRule, it is the name of an event 😉
So, taking in account it is an Header, then what you are looking for is mostly something like the following:
when HTTP_REQUEST { if {[HTTP::header "Referer"] starts_with "http://myprivate_site.intra"} { you can forward the trafic to the final destination, or load balance it with the command "pool" XYZ_Pool forward } else { reject you can also send an HTTP Redirect if you want. }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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