private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
A virtual host is an alternative name, registered in DNS, for an IP address such that multiple domain names will resolve the the same IP of a shared server instance. If the content to be served to the aliases names is different, then a virtual host names need to be configured for each deployed context to indicate which names a context will respond to.
Virtual hosts are set on a context by calling the setVirtualHosts
or addVirtualHost
method which can be done either
Using a context XML file in the webapps directory (see the example in test.xml in the jetty distribution).
Using a WEB-INF/jetty-web.xml
file
(deprecated).
Creating a custom deployer with a binding to configure virtual hosts for all contexts found in the same webapps directory.
Calling the API directly on an embedded usage.
Jetty supports the following styles of virtual host name:
A fully qualified host name. It is important to list all variants as a site may receive traffic from both www.hostname.com and just hostname.com
A wildcard qualified host which will match only one level of arbitrary names. *.foo.com will match www.foo.com and m.foo.com, but not www.other.foo.com
An IP address may be given as a virtual host name to indicate that a context should handle requests received on that server port that do not have a host name specified (HTTP/0.9 or HTTP/1.0)
A connector name, which is not strictly a virtual host, but instead will only match request that are received on connectors that have a matching name set with Connector.setName(String).
Non ascii and IDN
domain names can be set as virtual host using Puny Code
equivalents that may be obtained from a Punycode/IDN
converters. For example if the non ascii domain name
www.√integral.com
is given to a browser, then it
will make a request that uses the domain name
www.xn--integral-7g7d.com
, which is the name that
should be added as the virtual host name.
See an error or something missing? Contribute to this documentation at Github!