Skip to content

godaralokesh29/ngxtui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngxtui

Configure Nginx reverse proxies and static sites in seconds — right from your terminal.

ngxtui is a lightweight Terminal UI that removes the pain of hand-editing Nginx config files. Create a reverse proxy, enable a site, validate, and reload with a few keystrokes — no vim, no hunting for config paths, no syntax headaches.

It is a Node.js port of the original Go utility, distributed as a single npm package.

📖 Docs / landing page: https://godaralokesh29.github.io/ngxtui/


Features

  • 🖥️ Interactive terminal menu
  • 🔁 Reverse-proxy (API) vhost generation with WebSocket support
  • 🌐 Static-site vhost generation with sensible caching
  • 🔗 Automatic sites-availablesites-enabled symlinking
  • ✅ Validates every change with nginx -t before reloading
  • ♻️ Reload via nginx -s reload, systemctl, or service — whatever your host has
  • 🧨 One-command reset to a clean, working default (with a confirmation guard)

Requirements

  • Linux or macOS (nginx lives at /etc/nginx; on Windows use WSL)
  • Node.js ≥ 18
  • nginx installed and on your PATH
  • root privileges (writing to /etc/nginx and reloading the service)

Install

npm install -g ngxtui

Or run once without installing:

sudo npx ngxtui

Usage

sudo ngxtui

Then follow the prompts:

? What would you like to do?
❯ Create API / reverse-proxy config
  Create static-site config
  Reset nginx to a clean default
  Exit

Other commands:

ngxtui --help       # show help
ngxtui --version    # print version

Example: expose a Node app on port 3000 at api.example.com

  1. sudo ngxtui
  2. Choose Create API / reverse-proxy config
  3. Project name: my-api, Port: 3000, Domain: api.example.com

ngxtui writes /etc/nginx/sites-available/my-api.conf, symlinks it into sites-enabled, runs nginx -t, and reloads. Done.

What it generates

A reverse-proxy server block looks like:

server {
    listen 80;
    server_name api.example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host              $host;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_cache_bypass $http_upgrade;
    }
}

Local development

git clone https://github.com/godaralokesh29/ngxtui.git
cd ngxtui
npm install
npm run build
sudo node dist/cli.js

License

MIT © godaralokesh29. Original concept by Bhargav16exd. Issues and PRs welcome.

About

terminal UI utility for managing Nginx configurations without the hassle of editing config files in VM manually.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors