Whole bunch of changes and releases
This commit is contained in:
parent
07143cfb36
commit
54947f15c2
36 changed files with 3269 additions and 40 deletions
54
dat/nginx-confgen
Normal file
54
dat/nginx-confgen
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
=pod
|
||||
|
||||
nginx-confgen is a simple preprocessor and macro system for
|
||||
L<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.
|
||||
|
||||
=head2 Example
|
||||
|
||||
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 L<manual|https://dev.yorhel.nl/nginx-confgen/man> for more features.
|
||||
|
||||
|
||||
=head2 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.1.tar.gz | tar -xzf-
|
||||
./nginx-confgen <input.conf >output.conf
|
||||
|
||||
To compile from source, install L<Haskell Stack|https://haskellstack.org/> and run:
|
||||
|
||||
git clone git://g.blicky.net/nginx-confgen.git
|
||||
cd nginx-confgen
|
||||
stack install
|
||||
|
||||
The git repository is also available for L<online
|
||||
browsing|https://g.blicky.net/nginx-confgen.git/>.
|
||||
Loading…
Add table
Add a link
Reference in a new issue