Forum Discussion
david0512_20548
Nov 12, 2014Nimbostratus
HTTPS rewrite
Hi All,
Have a requirement to rewrite a https request to another url. That part is all good with "HTTP::header replace host ". However I need the server side connection to go out as a https conn...
nitass
Nov 17, 2014Employee
it looks okay to me. by the way, you may use starts_with instead of contains.
config
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:443
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
clientssl {
context clientside
}
http { }
serverssl {
context serverside
}
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
translate-port disabled
vs-index 14
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:443 {
address 200.200.200.101
}
}
}
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux
ltm rule qux {
when HTTP_REQUEST priority 100 {
log local0. "priority 100 HOST=[HTTP::host] URI=[HTTP::uri]"
}
when HTTP_REQUEST {
if { [HTTP::header host] contains "www.abc." and [HTTP::uri] starts_with "/t/" } {
HTTP::uri "/[HTTP::host][HTTP::uri]"
HTTP::header replace host "www.def.com"
}
}
when HTTP_REQUEST priority 1000 {
log local0. "priority 10000 HOST=[HTTP::host] URI=[HTTP::uri]"
}
}
log
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
Nov 17 15:34:38 ve11a info tmm[14741]: Rule /Common/qux : priority 100 HOST=www.abc.com URI=/t/abc
Nov 17 15:34:38 ve11a info tmm[14741]: Rule /Common/qux : priority 10000 HOST=www.def.com URI=/www.abc.com/t/abc
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