Skip to content

denizdogan/dhall-nginx

Repository files navigation

dhall-nginx

Generate your Nginx configuration files using Dhall.

Loosely based on torbencarstens/dhall-nginx.

Build

Usage

let ng = https://raw.githubusercontent.com/denizdogan/dhall-nginx/v0.2/package.dhall

in ng.config::{ ... }

See example 1 and its accompanying .conf file for example input and output.

$ dhall text --file config.dhall

Documentation

Examples

The easiest way to get started is probably by looking at the examples in _tests where you can find pairings of Dhall input files and their output Nginx configurations. Note that some of the output files will look slightly different from what they were based on, because this library doesn't support e.g. include directives -- instead of that, just use Dhall's mechanisms to "include" parts.

Additionally, there is:

  • example - a random configuration for testing purposes

Access rules (allow and deny)

Since the internal order of the allow and deny directives matters, they are configured as a list of "access rules". Their common type is called access_rule.

/etc/nginx/fastcgi_params

A Dhall version of the default /etc/nginx/fastcgi_params has been included in utils/helpers/fastcgi_params.dhall.

mime.types

A Dhall version of the default mime.types has been included in utils/helpers/mime_types.dhall.

Missing features

Development

$ make format  # format all files
$ make freeze  # freeze all imports
$ make lint    # lint all files
$ make test    # run all tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages