Rewriting the existing host header of the HTTP request when the HTTP request passes the ServerIron
Some web server/applications require the host header to be rewritten/altered for application compatibility on real server(s). Clients connect to the virtual server in front of the real servers using the FQDN of the virtual server as host header. A virtual server with the IP address a.b.c.d might be known as www.whatever.com and incoming HTTP requests would have the following host header:
The example below covers the following case:
The load balancer/ServerIron might do a port mapping on the way to the real servers. Incoming requests do use port 80 but the real server do listen at port 81. The real servers need to see their own port in the host header in some cases to prevent application problems. The header
Host: www.whatever.com needs to get changed to
csw-rule "www.whatever.com" header "host" equals "WWW.WHATEVER.COM" case-insensitive
csw-policy "pol" case-insensitive
match "www.whatever.com" forward 1
match "www.whatever.com" rewrite request-insert ":81"
server real rs101 184.108.40.206
port 81 group-id 1 1
server virtual vs222 192.168.8.222
port http csw-policy "pol"
port http csw
bind http rs101 81