Config 4.1: Protect Static Content

In pattern, set Case to be Static,  and assign a protected role in the pattern match or in Que.

For this case, the matched content is a permanent static file such as an image, a video or a PDF. By inspecting if there is a protected role from the match, you can enforce visitors to login before viewing it. For example, visiting to


will be matched to the pre-defined pattern

"Reg": "^\/(\w+)/(\d+)\.(\w+)\/$"
"Mats": ["role", "book_id", "tag"]
"Case": "Static"

From the matched list of variables, we have role=admin, book_id=1234 and tag=html. Since admin is a protected role, one has to login in order to view the file.

The Static case will always look for a static file on disk, whether or not it actually exists. If not, a 404 Not Found error will be displayed.