NGINX CONFIGURATION CLI
Manage Nginx without the repetition.
ngxctl is a command-line utility for generating, managing, validating, and deploying clean Nginx configurations.
$ ngxctl create reverse-proxy \
--domain api.example.com \
--port 3000
→ writing sites-available/api-example-com
→ testing configuration syntax
✓ nginx -t passed
→ enabling symlink
✓ reloaded nginx
$
Why it exists
One server block, written by hand, every time
A reverse proxy with WebSocket support is a dozen lines you've written before. ngxctl writes them, tests them, and reloads Nginx in one pass.
Without ngxctl
# /etc/nginx/sites-available/api
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 Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# then, by hand:
$ sudo ln -s sites-available/api sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginx
14 lines, one typo from a failed reload.
With ngxctl
$ ngxctl create reverse-proxy \
--domain api.example.com \
--port 3000 \
--websocket
→ writing sites-available/api-example-com
✓ nginx -t passed
→ enabling symlink
✓ reloaded nginx
One command. Tested before it's applied.
Command reference
A small, predictable surface
Nine commands cover the entire lifecycle — creating a site, checking on it, and rolling it back.
create
ngxctl createlaunch the interactive setup wizard
ngxctl create reverse-proxyproxy a backend on a given port
ngxctl create staticserve a static build, with optional SPA routing
ngxctl create phpserve a PHP-FPM backed document root
manage
ngxctl listshow every site and its enabled state
ngxctl inspectview paths, symlinks, and directives
ngxctl enable / disabletoggle a site, test, and reload
operate
ngxctl testrun nginx -t and report the result
ngxctl reload / restartapply changes to the running service
ngxctl backup create / list / restoresnapshot and roll back a configuration