All Projects → zweifisch → nginx-sites

zweifisch / nginx-sites

Licence: other
manage nginx vhost configs

Programming Languages

python
139335 projects - #7 most used programming language
Nginx
273 projects

nginx-sites

cli utility for managing nginx vhost configs

install using pip

pip install nginx-sites

usage

ngx ls
ngx enable <name>
ngx disable <name>
ngx new <name> [--path=<path>] [--template=<template>] [(--port=<port>)...]
ngx rm <name>
ngx open <name>
ngx cp <source> <target>
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:

{
    "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:

ngx new myapp.dev --template=mytemplate
ngx reload
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].