Nginx module for Augeas
Authors: Ian Berry ibe@barrac uda.com Raphael Pinson rryraphael@camptoc amp.com .pinson
Nginx | Nginx module for Augeas |
Reference | This module was built to support a limited subset of nginx configuration syntax. |
License | This file is licenced under the LGPL v2+, like the rest of Augeas. |
Lens Usage | To be documented |
Configuration files | This lens applies to /etc/nginx/nginx.conf. |
Examples | The Test_Nginx file contains various examples and tests. |
TODO | |
Augeas Variables | |
word | |
block_re | The keywords reserved for block entries |
Augeas Lenses | |
simple | A simple entry |
server | A simple server entry |
block | A block containing simple entries |
lns | |
Augeas Variables | |
filter |
This lens applies to /etc/nginx/nginx.conf. See filter.
The Test_Nginx file contains various examples and tests.
let block (entry : lens) = [ Util.indent . block_head . Build.block_newlines entry Util.comment . Util.eol ]
A block containing simple entries
let word = /[A-Za-z0-9_.:-]+/
The keywords reserved for block entries
let block_re = "http" | "events" | "server" | "mail" | "stream"
A simple entry
let simple = let kw = word - block_re_all in let mask = [ label "mask" . Util.del_str "/" . store Rx.integer ] in let sto = store /[^ \t\n;#]([^";#]|"[^"]*\")*/ in [ Util.indent . key kw . mask? . (Sep.space . sto)? . Sep.semicolon . (Util.eol|Util.comment_eol) ]
A simple server entry
let server = let address = /[A-Za-z0-9_.:\/-]+/ in [ Util.indent . label "@server" . Util.del_str "server" . [ Sep.space . label "@address" . store address ] . [ Sep.space . key word . (Sep.equal . store word)? ]* . Sep.semicolon . (Util.eol|Util.comment_eol) ]
A block containing simple entries
let block (entry : lens) = [ Util.indent . block_head . Build.block_newlines entry Util.comment . Util.eol ]
let lns = ( Util.comment | Util.empty | directive )*