Virtual multihosting is a feature which enables an origin server, such as a reverse proxy server, to respond to multiple DNS aliases as if a different server was installed in each of those addresses. As an example, suppose you have the DNS host names:
www
specs
phones
Each of these host names could be mapped to the same IP address, the IP address of the reverse proxy. the reverse proxy could then act differently based on which DNS name was used to access it.
Virtual Multihosting enables you to host multiple different *domains* in a single reverse proxy server as well. For example:
www.domain-1.com
www.domain-2.com
www.domain-3.com
You can have a combination of multiple local host names as well as multiple domains, all in a single proxy server:
www
specs
phones
www.domain-1.com
www.domain-2.com
www.domain-3.com
The virtual multihosting feature works by specifying the DNS host and domain names or aliases, and then a target URL prefix where requests sent to that host name should be directed. As an example, suppose you have two mappings:
engr.domain.com -> http://int-engr.domain.com
mktg.domain.com -> http://int-mktg.domain.com
Mappings do not have to go root-to-root. You may specify an additional URL path prefix in the target URL:
engr.domain.com -> http://internal.domain.com/engr
mktg.domain.com -> http://internal.domain.com/mktg
The same technique applies to virtual domain mappings. For example, you could use:
www.domain-1.com -> http://int-engr.domain.com
www.domain-2.com -> http://int-mktg.domain.com
The system will look at the HTTP “Host:” header. Based on that header, the system will choose the matching Virtual Multihosting mapping. If none of the multihosting mappings match, the server will continue looking at other mappings in the order that they appear in the configuration file, or perform no mappings if no matches are found. If no matches are found, the proxy will typically issue the “Proxy denies fulfilling the request” response.
Access the Server Manager and click the URLs tab.
Click the Configure Virtual Multihosting link.
The Configure Virtual Multihosting page is displayed.
In the Source Hostname (alias) field, specify the local host name (or DNS alias) that this mapping should apply to.
In the Source Domain Name field, type the local domain name that this mapping should apply to.
Typically, this name is your own network’s domain name, unless you want to multi host multiple different DNS domains.
In the Destination URL Prefix field, type the target URL prefix where the request will be directed if the host and domain names match the above specifications.
If you are using templates, choose the template name from the Use This Template drop-down list, or leave the value at NONE if you do not want to apply a template.
Click OK.
Click Restart Required.
The Apply Changes page is displayed.
Click the Restart Proxy Server button to apply the changes.
Repeat the above steps for each virtual multihosting mapping you want to establish.
All virtual multihosting mappings appear on the bottom of the Configure Virtual Multihosting page. The Source Hostname (alias) and Source Domain Name fields are merged, together with the proxy’s port number, into a single regular expression that is used to match the “Host:” header.
For example, if you have host name www, domain example.com, and port number 8080, the following regular expression will appear:
www(|.example.com)(|:8080)
This regular expression guarantees a match with all of the following possible combinations that the user might have typed, or the client might have sent. The port number might be omitted by some client software even when it is non-80, as the server was listening on that port.
www
www:8080
www.example.com
www.example.com:8080
You will need to disable the Client autoconfiguration feature before you can configure reverse proxy mappings. The Client autoconfiguration feature is for the forward proxy operation, not reverse proxy.
The Virtual Multihosting feature establishes automatic reverse mappings. Do not create reverse mappings for mappings that you provide using the Virtual Multihosting page.
Virtual mappings are specified with virt-map function in the obj.conf file.
Virtual mappings are matched in the order specified in the obj.conf configuration file. If regular, reverse, regular expression, or client autoconfiguration mappings appear before the virtual mappings, they will be applied first. Similarly, if no matches are found in virtual mappings, translation will continue to the next mapping after the virtual mapping section in obj.conf.
In the order of specification, reverse mapping should appear before other mappings.
If the port number of the proxy server is changed, you will need to recreate the Virtual Multihosting mappings, to reflect the new port number.