This has several Multi-Site examples in the folders starting with the words multi-site-. Here is an overview of a few of them.
Basic Multi-Site configured in server.json
Here is a basic server.json configuring several sites. Here we have some defaults configured in the web object for all sites, including a single HTTP binding to all IPs on port 80. There is a custom host alias configured on each site. There is a site called "default" which is set to the default site with default=true in the site object.
This example server contains custom HTTP and SSL bindings for each server. You'll probably never need anything this complex, but we support it all! The HTTP port 81 binding on all IPs, SSL binding on port 444, and AJP binding on port 8010 are shared by all sites. Each site then adds additional bindings specific to the site. Needless to say, there are multiple URLs that lead to each site.
This example server configures some defaults in the web object and then simply points to the web root of several sites where a .site.json file is waiting to further configure each site:
This example is similar to above, but instead of pointing to the web root of each site, it points to the site config file for each site, which is stored outside of the web roots:
In this example, the site1.json, site2.json, site3.json, and default.json files all live in the same directory as the server.json and would point to their respective webroots like so:
site1.json
{
"hostAlias":"site1.com",
"webroot":"site1"
}
SiteConfigFiles globbing pattern
In this example, we have a single file globbing pattern that points to a directory of JSON files that define the sites: