This module was built to support a limited subset of nginx configuration syntax. It works fine with simple blocks and field/value lines.
This file is licenced under the LGPL v2+, like the rest of Augeas.
This lens applies to /etc/nginx/nginx.conf. See filter.
The Test_Nginx file contains various examples and tests.
- Convert statement keyworks for a regex
- Support more advanced block syntax (location)
|let block_re = "http" | "events" | "server" | "mail" | "stream"
The keywords reserved for block entries
|let simple =
let kw = Rx.word - block_re_all
in let sto = store /[^ \t\n;][^;]*/ . Sep.semicolon
in [ Util.indent . key kw . Sep.space . sto . (Util.eol|Util.comment_eol) ]
A simple entry
|let block (entry : lens) =
[ Util.indent . block_head
. Build.block_newlines entry Util.comment
. Util.eol ]
A block containing simple entries
|let lns = ( Util.comment | Util.empty | directive )*