Forum Discussion
DM_5174
Nov 02, 2011Nimbostratus
Redirect to another POOL with URI and port
Hi All,
I was wondering if there is a way to redirect a URI to POOL and keeping
the URI? Below are the irule to send to the pool, however, I could not figure out
or know if there is a way to keep the uri also when sending to this pool...Example of what is needed:
1. external users goes to http://www.mydomain.com/soap/newapp1
2. based on matching the URI "/soap/newapp1", they are forwarded to a member in the SOAP_POOL that is listening on port 8080, however during this, the URI needs to match "http://192.168.2.100:8080/soap/newapp1".NOTE: We do not want to redirect from one link to another since this server is internal and not accessible to internet clients. So, if I was an external users and i enter
"http://www.mydomain.com/soap/newapp1", I SHOULD not get redirected to
"http://192.168.2.100/soap/newapp1" because they will not be able to access the
internal IP of the web server.POOL: SOAP_POOL
Member: 192.168.2.100:8080
when HTTP_REQUEST {
if {[HTTP::uri] equals {"/soap/newapp1/"}}
{
pool SOAP_POOL
}
switch -glob [string tolower [HTTP::uri]] {
"/app1*" -
"/app2*" -
"/app3*" -
"/app4*" -
{
pool APACHE_SERVER_POOL }
default {
pool IIS_WEB_POOL
}
}
}
-DM
- nitassEmployeedoes pool member really expect 192.168.2.100:8080 host header?
1 [root@iris:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.17.33:http ip protocol tcp profiles { http {} tcp {} } } [root@iris:Active] config b pool foo list pool foo { members 10.10.70.110:webcache {} } [root@iris:Active] config ssldump -Aed -nni 0.0 port 80 or port 8080 New TCP connection 1: 172.28.17.20(56735) <-> 172.28.17.33(80) 1320253103.1999 (0.0009) C>S --------------------------------------------------------------- GET /soap/newapp1 HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: www.mydomain.com Accept: */* --------------------------------------------------------------- New TCP connection 2: 10.10.72.30(56735) <-> 10.10.70.110(8080) 1320253103.2002 (0.0003) C>S --------------------------------------------------------------- GET /soap/newapp1 HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: www.mydomain.com Accept: */* 2 [root@iris:Active] config b virtual bar list virtual bar { snat automap pool foo destination 172.28.17.33:http ip protocol tcp rules myrule profiles { http {} tcp {} } } [root@iris:Active] config b pool foo list pool foo { members 10.10.70.110:webcache {} } [root@iris:Active] config b rule myrule list rule myrule { when HTTP_REQUEST_SEND { clientside { HTTP::header replace Host [LB::server addr]:[LB::server port] } } } [root@iris:Active] config ssldump -Aed -nni 0.0 port 80 or port 8080 New TCP connection 1: 172.28.17.20(33195) <-> 172.28.17.33(80) 1320253325.7189 (0.0007) C>S --------------------------------------------------------------- GET /soap/newapp1 HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: www.mydomain.com Accept: */* --------------------------------------------------------------- New TCP connection 2: 10.10.72.30(33195) <-> 10.10.70.110(8080) 1320253325.7194 (0.0004) C>S --------------------------------------------------------------- GET /soap/newapp1 HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 10.10.70.110:8080 Accept: */*
- DM_5174Nimbostratusnot exactly, the external users should not see or get redirected to the 192.168.2.100 address since this is an internal non-routable IP.
- DM_5174Nimbostratusnot exactly, the external users should not see or get redirected to the 192.168.2.100 address since this is an internal non-routable IP.
- DM_5174NimbostratusCan any help or even know this is even possible? I have been digging through the past forum and have not seen any thread of this ever being done, or even possible to do...
- Michael_YatesNimbostratusHi DM,
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/soap/newapp1*" { pool SOAP_POOL } "/app1*" - "/app2*" - "/app3*" - "/app4*" { pool APACHE_SERVER_POOL } } default { pool IIS_WEB_POOL } }
- DM_5174NimbostratusYou are the man Michael...that did it!!!
- Michael_YatesNimbostratusThanks. Glad I could help. :-)
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