npm.io
1.0.3 • Published 7 years ago

nginx-autoconfig

Licence
MIT
Version
1.0.3
Deps
1
Size
7 kB
Vulns
0
Weekly
0

NGINX Autoconfiguration

A library that generates your NGINX confguration files on http requests.

Syntax for configuration files:

Normal nginx syntax, but you can use ${VAR_NAME} anywhere. Where "VAR_NAME" is a variable, which gets interpolated into your config.

Use:

Example 1 Example 2 Example 3

  1. $ npm i nginx-autoconfig
  2. something like this: nginxAutoConfig.start("config", 18888, SECRET, "/etc/nginx/conf.d/", () => { return { BACKEND_PORT: 3000 } });
  3. write a config file and put it into the "config" folder
  4. $ sudo node file.js
  5. Profit.