As soon as CommandBox flips over to Multi-Site mode, the settings in the web
object will become defaults that apply to all sites. This allows you to group global settings into the top-level web
object and then override what you need for each site. Here is the full order of precedence for what settings will be applied:
settings in a
.site.json
file inside a web root of a sitesettings in an external site JSON file pointed to by the
siteConfigFiles
setting inserver.json
site-specific object in the
sites
object ofserver.json
settings in the
web
object ofserver.json
server.default
settings in CommandBox's global config settings
Settings global to a server
Since all sites for a given server do run inside the same JVM, there are some settings which cannot be customized on a per-site basis. They are as follows:
JRE/JDK the server runs on
JVM args, heap size
CF Engine/version
Console log
Tuckey Rewrites (part of servlet)
Environment Variables
Tray icon (there is a single tray icon for the entire server)
Per-site settings
Everything normally set in the web
block of your server.json
can be configured separately for each site. These settings include:
GZIp enabled and GZip predicate
Access log
Use proxy forwarded IP
CommandBox Server Rules (Undertow Predicate Language)
SSL settings (HSTS, SSL Redirect)
Block CF Admin
Block flash remoting
Block sensitive paths
Security
Basic auth
Client cert auth
Security predicate
Custom error pages (404, 500, etc)
Mime types
Welcome files
Allowed file extensions
Directory browsing
Aliases/Virtual dirs
File cache settings
Case sensitive paths
Web root
Server Profile (even though this is not inside the
web
object in yourserver.json
, it can still be set in asites
block to override for that site.)
And remember, all of the settings in the section above can be defaulted for all sites in the web
block at the top of your server.json
and then overridden in the sites.siteName
block or in a .site.json
file.
Debugging settings
There is much-improved console output now coming from Runwar when the server starts up. Add --verbose
or --debug
to your server start
command and you'll see site debug output at the top of the server start in the interactive job output:
Furthermore, once the actual server process gets underway, with the --trace
flag you'll see additional console output like so:
Last updated