Nginx

Nginx module for Augeas

Authors: Ian Berry ibe.nosp@m.rry@barrac.nosp@m.uda.com Raphael Pinson raphael.nosp@m..pinson@camptoc.nosp@m.amp.com

Summary
NginxNginx module for Augeas
ReferenceThis module was built to support a limited subset of nginx configuration syntax.
LicenseThis file is licenced under the LGPL v2+, like the rest of Augeas.
Lens UsageTo be documented
Configuration filesThis lens applies to /etc/nginx/nginx.conf.
ExamplesThe Test_Nginx file contains various examples and tests.
TODO
Augeas Variables
block_reThe keywords reserved for block entries
Augeas Lenses
simpleA simple entry
blockA block containing simple entries
lns
Augeas Variables
filter

Reference

This module was built to support a limited subset of nginx configuration syntax.  It works fine with simple blocks and field/value lines.

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.  See filter.

Examples

The Test_Nginx file contains various examples and tests.

TODO

  • Convert statement keyworks for a regex
  • Support more advanced block syntax (location)

Augeas Variables

block_re

let block_re = "http" | "events" | "server" | "upstream" | "location" | "if"

The keywords reserved for block entries

Augeas Lenses

simple

let simple = let kw = Rx.word - block_re in let sto = store /[^ \t\n;][^;]*/ . Sep.semicolon in Build.key_value_line_comment kw Sep.space sto Util.comment_eol

A simple entry

block

let block = let entry = Util.indent . simple in [ key block_re . Build.block_newlines entry Util.comment . Util.eol ]

A block containing simple entries

lns

let lns = ( Util.comment | Util.empty | simple | block )*

Augeas Variables

filter

Provides unit tests and examples for the Nginx lens.
let block_re = "http" | "events" | "server" | "upstream" | "location" | "if"
The keywords reserved for block entries
let simple = let kw = Rx.word - block_re in let sto = store /[^ \t\n;][^;]*/ . Sep.semicolon in Build.key_value_line_comment kw Sep.space sto Util.comment_eol
A simple entry
let block = let entry = Util.indent . simple in [ key block_re . Build.block_newlines entry Util.comment . Util.eol ]
A block containing simple entries
let lns = ( Util.comment | Util.empty | simple | block )*
Close