#nginx #config #parser

nginx-config

A parser, AST and formatter for nginx configuration files

18 releases (11 breaking)

Uses old Rust 2015

0.13.2 Aug 15, 2018
0.13.0 Jul 24, 2018
0.3.0 Mar 26, 2018

#2480 in Parser implementations

Download history 18/week @ 2023-11-02 15/week @ 2023-11-09 26/week @ 2023-11-16 28/week @ 2023-11-23 61/week @ 2023-11-30 26/week @ 2023-12-07 42/week @ 2023-12-14 43/week @ 2023-12-21 23/week @ 2023-12-28 14/week @ 2024-01-04 9/week @ 2024-01-11 44/week @ 2024-01-18 35/week @ 2024-01-25 32/week @ 2024-02-01 29/week @ 2024-02-08 176/week @ 2024-02-15

273 downloads per month
Used in nginx-config-mod

MIT/Apache

125KB
3.5K SLoC

Nginx Config Parser (unofficial)

Documentation | Github | Crate

A parser, formatter and AST for nginx configs.

The goal is to:

  1. Validate nginx config, including custom rules
  2. Validate partial configs like location or server directive
  3. Extract facts from nginx config, like domains served or upstream list
  4. Support simple config rewritings like replace variable with actual value
  5. Generate nginx configs

We're starting with small subset of the nginx directives. And we're unlikely be supporting all of the config in the nearest future. But PR's on additional directives are accepted.

Non-goals:

  • Being replacement for nginx -t

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1MB
~23K SLoC