A TypeScript library for controlling Nginx from Node.js, with support for generating and managing Nginx configurations dynamically.
dist | ||
test | ||
ts | ||
.gitignore | ||
.gitlab-ci.yml | ||
LICENSE | ||
npmextra.json | ||
package-lock.json | ||
package.json | ||
qenv.yml | ||
README.md | ||
tslint.json |
smartnginx
control nginx from node, TypeScript ready
Status
Features
- easy reverse configuration
- automatic letsencrypt DNS01 challenge based ssl cert generation
- automatic nginx process handling zero-downtime config reloading
- works in Docker environements
Usage
We recommend the use of TypeScript! :)
import * as smartnginx from 'smartnginx';
const smartnginxInstance = new smartnginx.SmartNginx();
myNginxHost = new smartnginx.NginxHost({
hostName: 'some.example.com',
type: 'reverseProxy',
destination: '192.192.192.192' // some destination IP
});
myNginxConfig.addZone(myNginxZone); // adds the zone to the config
myNginxConfig.deploy(); // deploys the referenced NginxConfig and gracefully reloads it