Skip to content

Nginx

Fleet generates nginx server blocks, writes them to /etc/nginx/sites-available/, symlinks them to sites-enabled/, tests the config, and reloads nginx.


fleet nginx add

Create an nginx server block for a domain and reload nginx.

Usage

Terminal window
fleet nginx add <domain> --port <port> [--type proxy|spa|nextjs] [--dry-run] [-y]

Arguments

ArgumentRequiredDescription
domainYesDomain name (e.g. myapp.example.com)

Flags

FlagDescription
--port <port>Backend port (required)
--type proxy|spa|nextjsConfig type (default: proxy)
--dry-runPrint the generated config without writing it
-y, --yesSkip confirmation prompts

Config types

TypeDescription
proxyReverse proxy to a backend port (default)
spaStatic SPA with try_files fallback to index.html
nextjsNext.js-specific proxy with static asset handling

Examples

Terminal window
$ fleet nginx add myapp.example.com --port 3000
Installed myapp.example.com.conf
Nginx config test passed
Nginx reloaded - myapp.example.com is live
Run certbot to add SSL: certbot --nginx -d myapp.example.com -d www.myapp.example.com
Terminal window
$ fleet nginx add myapp.example.com --port 3000 --dry-run
Generated config:
server {
listen 80;
server_name myapp.example.com;
...
}
! Dry run - no changes made
Terminal window
$ fleet nginx add myapp.example.com --port 3000 --type spa
  • MCP tool: fleet_nginx_add

fleet nginx remove

Remove an nginx server block and reload nginx.

Usage

Terminal window
fleet nginx remove <domain> [-y]

Arguments

ArgumentRequiredDescription
domainYesDomain name to remove

Flags

FlagDescription
-y, --yesSkip confirmation prompt

Examples

Terminal window
$ fleet nginx remove myapp.example.com
? Remove nginx config for myapp.example.com? (y/N) y
Removed myapp.example.com.conf
Nginx reloaded

fleet nginx list

List all nginx site configs managed in sites-available/.

Usage

Terminal window
fleet nginx list [--json]

Flags

FlagDescription
--jsonOutput raw JSON

Examples

Terminal window
$ fleet nginx list
Nginx Sites (2)
DOMAIN STATUS SSL
myapp.example.com enabled ssl
api.example.com enabled no ssl
  • MCP tool: fleet_nginx_list