Allows viewing and managing Nginx configuration files. It simplifies the relationship between sites_available and sites_enabled and makes it easy to manage.
Step 1: Clone repository
git clone https://github.com/aykutkardas/nginx-cli
Step 2: Install dependencies
pip install
Step 3: Added alias
echo "alias ngx=\"python `python ./main.py setup`\"" >> ~/.bashrc
List all configurations with their statuses
ngx list
+-----------------+--------+
| Conf File Name | Status |
+-----------------+--------+
| default | enable |
| github.com.conf | enable |
| google.com.conf | |
| test.conf | |
+-----------------+--------+
Enable a configuration. This adds a symlink of the enabled configuration file to the sites_enabled directory.
ngx enable -n test.conf
+-----------------+--------+
| Conf File Name | Status |
+-----------------+--------+
| default | enable |
| github.com.conf | enable |
| google.com.conf | |
| test.conf | enable |
+-----------------+--------+
Disable a configuration. This deletes the symlink of the disabled configuration file from the sites_enabled directory.
ngx disable -n test.conf
+-----------------+--------+
| Conf File Name | Status |
+-----------------+--------+
| default | enable |
| github.com.conf | enable |
| google.com.conf | |
| test.conf | |
+-----------------+--------+