An open API service indexing awesome lists of open source software.

https://github.com/zweifisch/nginx-sites

manage nginx vhost configs
https://github.com/zweifisch/nginx-sites

Last synced: 12 months ago
JSON representation

manage nginx vhost configs

Awesome Lists containing this project

README

          

# nginx-sites

cli utility for managing nginx vhost configs

install using pip
```sh
pip install nginx-sites
```

## usage

```sh
ngx ls
ngx enable
ngx disable
ngx new [--path=] [--template=] [(--port=)...]
ngx rm
ngx open
ngx cp
ngx --version
```

examples

```
ngx new nodejs.test --template=node --port=3003 --port=3004
ngx new phpfpm.test --template=php --port=9000
service nginx reload
```

## adding new vhost templates

Copy the directory `/usr/local/lib/python2.7/dist-packages/nginx_sites/templates` to `~/.nginx-sites-templates`

Edit the configuration file `~/.nginx-sites.json` and set it according to the settings below:

```json
{
"templates_path": "/home/username/.nginx-sites-templates",
"sites_available": "/etc/nginx/sites-available",
"nginx_bin": "/usr/sbin/nginx",
"sites_enabled": "/etc/nginx/sites-enabled"
}
```

Create your templates in `~/.nginx-sites-templates`

After setting up your new template, it is available for use with the command:

```sh
ngx new myapp.dev --template=mytemplate
ngx reload
```