/nginx-cli

Primary LanguageJavaScript

nginx-cli

Allows viewing and managing Nginx configuration files. It simplifies the relationship between sites_available and sites_enabled and makes it easy to manage.

ngnx preview


Install

npm install -g nginx-cli

Initialize

You must install it as sudo.

$ sudo ngnx init

Commands

ngnx list

$ ngnx list

# Output #
┌───────────┬─────────┐
│ Conf Name │ Status  │
├───────────┼─────────┤
│ default   │ enabled │
├───────────┼─────────┤
│ test.conf │         │
└───────────┴─────────┘

ngnx enable <conf_name>

$ ngnx enable test.conf

# Output #
┌───────────┬─────────┐
│ Conf Name │ Status  │
├───────────┼─────────┤
│ default   │ enabled │
├───────────┼─────────┤
│ test.conf │ enabled │
└───────────┴─────────┘

ngnx disable <conf_name>

$ ngnx disable test.conf

# Output #
┌───────────┬─────────┐
│ Conf Name │ Status  │
├───────────┼─────────┤
│ default   │ enabled │
├───────────┼─────────┤
│ test.conf │         │
└───────────┴─────────┘