Forum Discussion
Micka_61352
Jul 21, 2011Nimbostratus
Redirect traffic to root directory on server pool
Hi there,
Wondering if anyone can help. Will this iRule work. I want to be able to look at URL straing for data and send it to specific pool listening on port 81 once it hits this pool to have it look in the root forward. If these are not met send traffic to a different pool.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/data/" } {
pool IESDWEB_HTTP_81} { "/"
} else {
pool IESDWEB_HTTP
}
}
Regards,
Michael.
- The_BhattmanNimbostratusHi Michael,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/data/*" { HTTP::uri "/" pool IESDWEB_HTTP_81 } default { pool IESDWEB_HTTP } } }
- Micka_61352NimbostratusThank you for you comment.
- The_BhattmanNimbostratusHi Michael,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/data/*" { HTTP::uri "/Account/LogOn" pool IESDWEB_HTTP_81 } default { pool IESDWEB_HTTP } } }
Note: I haven't tested this method out before so hopefully it workswhen HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/data/*" { HTTP::uri ":81/Account/LogOn" pool IESDWEB_HTTP_81 } default { pool IESDWEB_HTTP } } }
- Micka_61352NimbostratusHi Batmann
- Micka_61352Nimbostratus
Hi Bhattmann
Thanks for you comments but still have issue. Have some further detail about issue, uri starts with /DATA/ send to specific pool, the request should not be sent to Data folder(as this does not exist) but to redirect them to root folder on IIS folder structure on specific server with pool. If not matching this send to default pool.
Or what would be the best way to handle this.
Thanks
- Michael_YatesNimbostratusThis iRule will remove the "/data" from your URI, but it will not replace the target document.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/data/*" { HTTP::uri [string map {"/data" ""} [string tolower [HTTP::uri]]] pool IESDWEB_HTTP_81 } default { pool IESDWEB_HTTP } } }
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