Secure Web Files
On this page
Introduction
Goal
Configure which web files are publicly accessible.
Background
Web files are static resources used by the web application. Some must be publicly accessible so the browser client can use them to render a web page, e.g. CSS and Javascript files. Others, such as Freemarker templates, are only used server-side and should be secured from public access. Which web files are publicly accessible is configured through an allowlist.
Allowing Public Access to Web Files
Which web files should be publicly (HTTP/HTTPS) accessible is configured through an allowlist. This is a file called hst-allowlist.txt in v15.x and hst-whitelist.txt in v14.x.
The allowlist file is located in the bundle's root directory. When the bundle's root directory is site, the allowlist is located in the project at
* When using v14.x, replace hst-allowlist.txt with hst-whitelist.txt.
Projects created using the Maven archetype contain a default allowlist that grants public access to the folders css/, fonts/ and js/. The default contents of the allowlist are: