# nginx-autoconfig

> Configures and restarts nginx on http requests

Latest version **1.0.3** (published 2019-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install nginx-autoconfig
pnpm add nginx-autoconfig
yarn add nginx-autoconfig
bun add nginx-autoconfig
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-25 |
| First published | 2019-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | FoseFx |
| Maintainers | fosefx |

## Links

- npm: https://www.npmjs.com/package/nginx-autoconfig
- Repository: https://github.com/FoseFx/nginx-autoconfiguration
- Homepage: https://github.com/FoseFx/nginx-autoconfiguration#readme
- Issues: https://github.com/FoseFx/nginx-autoconfiguration/issues
- npm.io page: https://npm.io/package/nginx-autoconfig

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1

## Recent versions

- 1.0.3 (latest) — 2019-03-25
- 1.0.2 — 2019-03-25
- 1.0.1 — 2019-03-25
- 1.0.0 — 2019-03-25

## README

# 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](examples/example.js)
[Example 2](examples/example2.js)
[Example 3](examples/example3.js)

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.

---
_Source: https://npm.io/package/nginx-autoconfig · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
