mod_fortune

mod_fortune loads quotes (aka fortune coookies) from a file and provides actions to add a random quote as response header (X-fortune) or display it as a page.

fortune.load (setup)

loads cookies from a file, can be called multiple times to load data from multiple files

fortune.load filename;
filename
the file to load the cookies from

fortune.header (action)

adds a random quote as response header "X-fortune".

fortune.header;

fortune.page (action)

shows a random cookie as response text

fortune.page;

Example

setup {
	module_load "mod_fortune";
	fortune.load "/var/www/fortunes.txt";
}

if req.path == "/fortune" {
	fortune.page;
} else {
	fortune.header;
}