Forum Discussion
teguh_wilidarma
Feb 07, 2011Nimbostratus
iRule HTTP redirection - one server multiple instance
Hi, I was digging through this forum and found several similar cases like mine, but I am still very newbie on how iRule commands interact with VS and pool member selection. Moreover, I havent managed to found any case that have the pool member running multiple instances of service. hope the wisemen here can help:
My customer is implementing a trading application which consists of more than one module, but running on the same machine (one web server running multiple instance):
for FE module:
1. forward "http://front_web" to "webserver_ip" at port 2020
2. forward "https://front_web/servlet/LiveGiverServlet" to "webserver_ip"at port 2025
for TR module:
1. forward "http://tr_web" to "webserver_ip" at port 4020
2. forward "https://tr_web/servlet/LiveGiverServlet" to "webserver_ip" at port 4025
I am thinking of when: HTTP_REQUEST , match condition: HTTP::host, and statement is HTTP::redirect to port something, and in "if" command.
But I can not think of how the traffic will flow as the irule is INSIDE virtual server, and the virtual server is listening on a particular IP address and service port. is it possible to create a single vs with 2 port to listen to (2020 and 2025 for FE module, 4020 and 4025 for TR module) ?
Is there a better way to do the task?
Thanks all
Teguh
- teguh_wilidarmaNimbostratusI don't know, will this work?
- teguh_wilidarmaNimbostratusYes that's correct Stefan, thank u for your reply.
- teguh_wilidarmaNimbostratushttp goes to 2020/4020, https with different URI goes to 2025/4025
- teguh_wilidarmaNimbostratusMy apology Stefan, do you mean that in HTTPS (with SSL), if not terminated on the LTM, then it can not read the URI?
- Sven_MuellerRet. EmployeeHi guys,
- hooleylistCirrostratusHi Sven,
when HTTP_REQUEST { switch [HTTP::host] { "front_web" { if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } { pool poolname_2025 } else { pool poolname_2020 } } "tr_web" { if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } { pool poolname_4025 } else { pool poolname_4020 } } } }
- teguh_wilidarmaNimbostratusPosted By hoolio on 02/08/2011 08:03 AM Hi Sven,
when HTTP_REQUEST { switch [HTTP::host] { "front_web" { if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } { pool poolname_2025 } else { pool poolname_2020 } } "tr_web" { if { [string tolower [HHTP::uri]] starts_with "/servlet/livegiverservlet" } { pool poolname_4025 } else { pool poolname_4020 } } } }
- hooleylistCirrostratusHere are a few articles and man pages for the various commands:
- teguh_wilidarmaNimbostratusThank you very much Aaron
- teguh_wilidarmaNimbostratusBtw Aaron, if you look at my first question, the web server is only one, with multiple instance. And for each instance, there will be two conditions. If http, then forward to the server using 2020, if it is https with particular URI, forward to the server using 2025. If I create only one VS for each module, how do I tell LTM to fulfil the second requirement? I am thinking that the VS for that server is only listening on port 80, and for the 443, I need to create another VS with the same server IP but listen on port 443. The member will be the same for both VS. Is it possible? what do you think Aaron?
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