Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/null93/vhost
NGINX config structure for provisioning virtual hosts with a CLI tool
https://github.com/null93/vhost
cli nginx virtual-host
Last synced: about 5 hours ago
JSON representation
NGINX config structure for provisioning virtual hosts with a CLI tool
- Host: GitHub
- URL: https://github.com/null93/vhost
- Owner: null93
- Created: 2022-07-08T05:38:25.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T16:36:09.000Z (8 months ago)
- Last Synced: 2024-06-19T21:57:26.177Z (5 months ago)
- Topics: cli, nginx, virtual-host
- Language: Go
- Homepage:
- Size: 3.44 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NGINX — vhost
> NGINX config structure for provisioning virtual hosts with a CLI tool
## About
This is a proposal for a new NGINX config structure that allows for provisioning virtual hosts with a CLI tool.
Please keep in mind that this is a proof of concept and the actual config files in the example nginx config directory are not complete.
It is the minimum viable product to demonstrate the CLI tool rather than a complete NGINX config.![demo-1](assets/demo-1.svg)
## Requirements
All you need is docker installed with the docker compose plugin.
## Try It Out
On your host machine, run the following commands:
```
docker-compose up -d
docker-compose exec nginx bash
```Once you are inside the docker container, you can create some virtual hosts:
```
vhost create catch-all default-backend
vhost enable default-backendvhost create wordpress my-blog domain_names=wordpress-127-0-0-1.nip.io
vhost enable my-blogvhost create magento-2 my-store magento_version=2.4.6.3 domain_names=magento-127-0-0-1.nip.io
vhost enable my-store
```Finally you can reload nginx to apply the changes:
```
nginx -s reload
```That's it! You can now visit the following URLs:
```
http://localhost
http://wordpress-127-0-0-1.nip.io
http://magento-127-0-0-1.nip.io
```## Install
Darwin
### Intel & ARM
```shell
brew tap null93/tap
brew install vhost
```Debian
### amd64
```shell
curl -sL -o ./vhost_0.0.3_amd64.deb https://github.com/null93/vhost/releases/download/0.0.3/vhost_0.0.3_amd64.deb
sudo dpkg -i ./vhost_0.0.3_amd64.deb
rm ./vhost_0.0.3_amd64.deb
```### arm64
```shell
curl -sL -o ./vhost_0.0.3_arm64.deb https://github.com/null93/vhost/releases/download/0.0.3/vhost_0.0.3_arm64.deb
sudo dpkg -i ./vhost_0.0.3_arm64.deb
rm ./vhost_0.0.3_arm64.deb
```Red Hat
### aarch64```shell
rpm -i https://github.com/null93/vhost/releases/download/0.0.3/vhost-0.0.3-1.aarch64.rpm
```### x86_64
```shell
rpm -i https://github.com/null93/vhost/releases/download/0.0.3/vhost-0.0.3-1.x86_64.rpm
```Alpine
### aarch64```shell
curl -sL -o ./vhost_0.0.3_aarch64.apk https://github.com/null93/vhost/releases/download/0.0.3/vhost_0.0.3_aarch64.apk
apk add --allow-untrusted ./vhost_0.0.3_aarch64.apk
rm ./vhost_0.0.3_aarch64.apk
```### x86_64
```shell
curl -sL -o ./vhost_0.0.3_x86_64.apk https://github.com/null93/vhost/releases/download/0.0.3/vhost_0.0.3_x86_64.apk
apk add --allow-untrusted ./vhost_0.0.3_x86_64.apk
rm ./vhost_0.0.3_x86_64.apk
```Arch
### aarch64```shell
curl -sL -o ./vhost-0.0.3-1-aarch64.pkg.tar.zst https://github.com/null93/vhost/releases/download/0.0.3/vhost-0.0.3-1-aarch64.pkg.tar.zst
sudo pacman -U ./vhost-0.0.3-1-aarch64.pkg.tar.zst
rm ./vhost-0.0.3-1-aarch64.pkg.tar.zst
```### x86_64
```shell
curl -sL -o ./vhost-0.0.3-1-x86_64.pkg.tar.zst https://github.com/null93/vhost/releases/download/0.0.3/vhost-0.0.3-1-x86_64.pkg.tar.zst
sudo pacman -U ./vhost-0.0.3-1-x86_64.pkg.tar.zst
rm ./vhost-0.0.3-1-x86_64.pkg.tar.zst
```