Forum Discussion
Yaniv_93956
Nimbostratus
Jan 21, 2013Using F5 as a proxy between two websites
Hello Devcentral,
I’m trying to set an IRule to act as a proxy between two websites without changing the URL in the user’s browser.
When user goes to
https://www.site1.com/test ...
nitass
Employee
Jan 21, 2013if both sites are managed by bigip, you may use virtual command instead.
e.g.
[root@ve10:Active] config b virtual bar1 list
virtual bar1 {
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/test" } {
HTTP::header replace Host "www.site2.com"
virtual bar2
}
}
}
[root@ve10:Active] config b virtual bar2 list
virtual bar2 {
snat automap
pool foo
destination 1.1.1.1:80
ip protocol 6
}
[root@ve10:Active] config b pool foo list
pool foo {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(47230) <-> 172.28.19.252(80)
1358775742.2911 (0.0010) C>S
---------------------------------------------------------------
GET /test/something 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
Accept: */*
Host: www.site1.com
---------------------------------------------------------------
New TCP connection 2: 172.28.19.251(47230) <-> 1.1.1.1(80)
1358775742.2913 (0.0000) C>S
---------------------------------------------------------------
GET /test/something 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
Accept: */*
Host: www.site2.com
---------------------------------------------------------------
New TCP connection 3: 200.200.200.253(47230) <-> 200.200.200.101(80)
1358775742.2931 (0.0017) C>S
---------------------------------------------------------------
GET /test/something 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
Accept: */*
Host: www.site2.com
---------------------------------------------------------------
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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