Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtgrosser/ngxc
Nginx configuration file compiler
https://github.com/mtgrosser/ngxc
compiler nginx-configuration
Last synced: 7 days ago
JSON representation
Nginx configuration file compiler
- Host: GitHub
- URL: https://github.com/mtgrosser/ngxc
- Owner: mtgrosser
- License: mit
- Created: 2015-10-27T19:15:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-13T20:53:58.000Z (3 months ago)
- Last Synced: 2024-08-13T23:54:53.244Z (3 months ago)
- Topics: compiler, nginx-configuration
- Language: Ruby
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/mtgrosser/ngxc.svg?branch=master)](https://travis-ci.org/mtgrosser/ngxc)
# ngxc - Nginx configuration compiler
Write your nginx configurations in Ruby - no Ruby required!
With ngxc, you can define dynamic nginx configuration macros as Ruby methods.
Verbose and repetitious configuration blocks can be condensed into a single line of code.## Building
In order to build ngxc, you need to build a customized version of mruby,
which includes some extra mrbgems. The default rake task will take care
of this.To build the ngxc binary, type:
```bash
rake
```## Integrating with systemd
If you want to update configurations when nginx is started or reloaded,
you can extend the systemd unit for nginx by dropping the ngxc.conf file
into /etc/systemd/system/nginx.service.d/ngxc.conf:```ini
[Service]
ExecStartPre=
ExecStartPre=/usr/bin/ngxc /etc/nginx/nginx.ngxc /etc/nginx/nginx.conf
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
ExecReload=
ExecReload=/usr/bin/ngxc /etc/nginx/nginx.ngxc /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
```