GJR-UK_248612
Jan 25, 2018Nimbostratus
irule to change http host based on port
Hi all, I have a need to change a http host based on port.
I have four virtual servers - same IP address but each listening on 443, 444,446,447.
The need is for all traffic to be sent to server.domain.co.uk on one of the four ports but then to rewrite the header and be sent to the pool member based on port to one of: server-443.domain.com
server-444.domain.com
server-446.domain.com
server-447.domain.com
all receiving on 443 This is so that the relevant log store can be hit
I have a different irule for each virtual server specific for the port and head: e.g.
when HTTP_REQUEST {
if { ([HTTP::host] eq "server.domain.co.uk") } {
HTTP::header replace Host "server-444.domain.com"
}
}
I'm finding that the "443" rule is hit every time even if one of the other ports is addressed.
Hoping I've not over-complicated the explanation.
Is there a neat way to get the result I'm after?