How to use Port numbers with ESP Allowed Virtual Hosts
When trying to add a hostname which contains a port number under the 'Allowed Virtual Host' ESP setting, you will receive an error indicating Invalid hostname list specification, or an Access Denied error after inputting the user credentials during the logon process.
Since the host that you want to allow through has the port number attached to it, we must first strip the port from the host with a content rule and then send the request to a Sub Virtual Service (SubVS) which will have ESP enabled.
Let's use the example of abc.com:8443
Create a 'Replace Header' rule. Rules & Checking > Content Rules > click 'Create New'
Apply the above rule to the parent VS under Advanced Properties > HTTP Header Modifications > Request Rules
Delete any real servers that you may have, and create a SubVS under Real Servers > click 'Add SubVS ...'
Within the SubVS, naviagte to ESP Options > click 'Enable ESP' > Allowed Virtual Hosts > abc.com
Let's verify the configuration.
First, we'll navigate to the virtual service by the IP address. We get a 403 Forbidden error mesage:
Next, we'll navigate using the hostname abc.com:8443 We get a 200 OK response back now: