Forum Discussion
rahulc_290651
Nimbostratus
Dec 29, 2016Bind URI with a secific virtual server
Hello Team,
Let's say we have 2 virtual server's configured and both of them are listening for same web server ( Same pool ) Our requirement is we should be able to restrict access on basis of URI. So if request comes for a specific URL: it should only work with virtual server a. If somebody changes the host file and add IP addreess of virtual server B for same domain name, it should not work.
1 Reply
- Stanislas_Piro2
Cumulonimbus
Hi,
you can try somthing like that (not tested)
when RULE_INIT { array set static::VS_HOST { /Common/VS1 "app1.company.com" /Common/VS2 "app2.company.com" } } whrn HTTP_REQUEST { if {[info exists static::VS_HOST([virtual name])] && [HTTP::host] ne $static::VS_HOST([virtual name])} { HTTP::respond 403 -version "1.1" content "Request RejectedYou are not authorized to access this page" noserver Connection Close } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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