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
- Host: GitHub
- URL: https://github.com/zweifisch/nginx-sites
- Owner: zweifisch
- Created: 2013-04-12T08:24:43.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-05-14T00:37:07.000Z (about 10 years ago)
- Last Synced: 2025-06-25T10:09:19.976Z (about 1 year ago)
- Language: Python
- Size: 18.6 KB
- Stars: 38
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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
```