Rewrite to static site
With a complete reorganisation of the directory structure and most of the content converted to pandoc-flavoured markdown. Some TODO's left before this can go live: - Main page - Atom feeds - Bug tracker
This commit is contained in:
parent
5c85a7d32f
commit
6242b2ee9c
291 changed files with 4346 additions and 6141 deletions
59
dat/nginx-confgen.md
Normal file
59
dat/nginx-confgen.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
% Nginx Configuration Generator
|
||||
|
||||
nginx-confgen is a simple preprocessor and macro system for
|
||||
[nginx](http://nginx.org/) and nginx-like configuration files. It support
|
||||
variable substitution, macro expansion and using the output of arbitrary
|
||||
commands to generate config files.
|
||||
|
||||
## Example
|
||||
|
||||
```bash
|
||||
pre_set $certdir /etc/nginx-certificates/;
|
||||
|
||||
# Fetch the 'resolver' from /etc/resolv.conf
|
||||
pre_exec $nameserver "grep nameserver /etc/resolv.conf \\
|
||||
| head -n 1 | sed 's/^nameserver //'";
|
||||
resolver $nameserver;
|
||||
|
||||
# Convenient macro to create a HTTPS virtual host
|
||||
macro vhost $domain @aliases &block {
|
||||
server {
|
||||
listen [::]:443 ssl;
|
||||
server_name $domain @aliases;
|
||||
|
||||
ssl_certificate $certdir/$domain/fullchain.pem;
|
||||
ssl_certificate_key $certdir/$domain/privkey.pem;
|
||||
pre_if -f $certdir/$domain/ocsp.der {
|
||||
ssl_stapling_file $certdir/$domain/ocsp.der;
|
||||
}
|
||||
|
||||
█
|
||||
}
|
||||
}
|
||||
|
||||
vhost example.com www.example.com {
|
||||
root /var/www/example.com;
|
||||
}
|
||||
```
|
||||
|
||||
See the [manual](/nginx-confgen/man) for more features.
|
||||
|
||||
## Download
|
||||
|
||||
If you're on a x86\_64 Linux system, you can simply use the binary:
|
||||
|
||||
```
|
||||
curl -s https://dev.yorhel.nl/download/nginx-confgen-linux-amd64-1.2.tar.gz | tar -xzf-
|
||||
./nginx-confgen <input.conf >output.conf
|
||||
```
|
||||
|
||||
To compile from source, install [Haskell Stack](https://haskellstack.org/) and run:
|
||||
|
||||
```
|
||||
git clone https://code.blicky.net/yorhel/nginx-confgen.git
|
||||
cd nginx-confgen
|
||||
stack install
|
||||
```
|
||||
|
||||
The git repository is also available for [online
|
||||
browsing](https://code.blicky.net/yorhel/nginx-confgen).
|
||||
Loading…
Add table
Add a link
Reference in a new issue