Forum Discussion
Andrew_Wilson_2
Nimbostratus
Jun 08, 2006A simple Reverse Proxy iRule
I'm completely new to the iRules and the BigIP in general. Here's what I've done:
I've created 8 nodes in total which specify internal webservers behind the F5 device. I've then created 8 pools to contain the correct webserver. I've then created a new Virtual Server called 'Reverse Proxy' which then has an iRule attached to it (See below)
What I want to do is if a client tries to connect to URL http://websever1.gov.uk it then looks at the iRule and then forwards it onto the correct pool etc etc
This is the iRule i've written which doesn't seem to want to play ball:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "webserver1.gov.uk" } {
pool webserver1.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver2.gov.uk" } {
pool webserver2.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver3.gov.uk" } {
pool webserver4.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver4.gov.uk" } {
pool webserver4.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver5.gov.uk" } {
pool webserver5.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver6.gov.uk" } {
pool webserver6.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver7.gov.uk" } {
pool webserver7.gov.uk
}
elseif { [HTTP::uri] starts_with "webserver8.gov.uk" } {
pool webserver8.gov.uk
}
}
If I do a tcpdump on the external interface I see the traffic coming into the F5 but then get a reset coming back from the VR VIP address. If I do the same tcpdump on the inside interface I don't see anything so the F5 doesn't seem to be forwarding the traffic.
I'd appreciate anyones help on this.
Andrew
- JRahm
Admin
you are searching for the host, not the uri. - Andrew_Wilson_2
Nimbostratus
Hi, - hoolio
Cirrostratus
Hi Andrew, - hoolio
Cirrostratus
- Andrew_Wilson_2
Nimbostratus
Many thanks for the help on this. I now have it working for http requests. I now need to also provide https access to the same servers but I don't want the F5 to do anything funky with the SSL. They want the SSL Cert to stay on the Servers so all I need is to push the SSL traffic directly through to the servers. The only way I can even see the traffic flow through the F5 is if I set the SSL Profile's for either Client Or Server. I then get the pop-up from the F5 (I pressume) and then I can see the request go out through the correct interface. If I don't have these set I see nothing going through. Can anyone give me any pointers.
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