When testing with the VIP on port 8004, does the client make requests with the port number in the Host header? If so, you could remove it using the Codeshare example:
http://devcentral.f5.com/Wiki/default.aspx/iRules/HTTPToHTTPSRedirect_302.html
when HTTP_REQUEST {
Check if Host header value has a length
if {[string length [HTTP::host]]}{
Redirect to the requested host and URI (minus the port if specified)
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
} else {
Redirect to VIP's IP address
HTTP::redirect https://[IP::local_addr][HTTP::uri]
}
}
Aaron