Forum Discussion
hooleylist
Sep 08, 2009Cirrostratus
Is there any hosts and/or URIs you want to serve on the port 1003 VS? If not, you could redirect every request to a hardcoded hostname and the original URI:
when HTTP_REQUEST {
Redirect client to hardcoded host and preserve the original URI
HTTP::redirect "https://affiliate.abc.com[HTTP::uri]"
}
Or if you only wanted to redirect requests where the host header value contains any port, you could use something like this:
when HTTP_REQUEST {
Check if Host contains a colon
if {[HTTP::host] contains ":"}{
Redirect client to hardcoded host and preserve the original URI
HTTP::redirect "https://affiliate.abc.com[HTTP::uri]"
}
}
Or if you want to redirect the client to the requested host without the port, you could use:
when HTTP_REQUEST {
Check if Host contains a colon
if {[HTTP::host] contains ":"}{
Redirect client to requested host minus the port and preserve the original URI
HTTP::redirect "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}
Hopefully that gives you a few ideas.
Aaron