Forwarding request to server based on URL directory (and files inside it)?
Hello all,
I've searched and found nothing that i'm looking for. I've got a request from an internal team that they need to forward user requests who hit webpage behind a particular directory.
Incoming requests connecting to any page behind "www.site.com/SPECIFIC_DIRECTORY/." to a specific server + port. I thought I could handle this with the following iRule (shared) switch config:
---iRule--- when HTTP_REQUEST { switch [string tolower [HTTP::host]] {
www.site.com {pool POOL_NAME_1}
www.site.com/specific_directory { pool POOL_NAME_2}
}
}
...This configuration didn't work, so I was thinking of using a redirect iRule:
---iRule--- when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] {
"/specific_directory*" { HTTP::redirect "http://server:port" }
}
} ...likewise this isn't working because the server we're trying to forward to is only available internally. If you're not on the LAN you won't resolve the server IP.
Is there a proper way of handling this? Any suggestions or even documentation would be of great help.
Thank you, Michael