nb env proxy caddy
nb env proxy caddy generates a Caddy proxy config for one CLI-managed env. It fits these cases well: you already have a domain, want HTTPS running quickly, and do not want to maintain too many TLS details yourself.
This command only works for managed envs whose runtime is reachable from the current machine, which means local or docker. It does not currently work for envs that only have a remote API connection or for SSH envs.
Usage
Parameters
Default output
If you do not pass --output, the CLI maintains these files under ~/.nocobase/proxy/caddy/:
Where:
generated.caddyis only meant to be managed by the CLI and should not be edited manuallyapp.caddyis editable, but you should keep the managed import inserted by the CLInocobase.caddyis mainly used by--install
If you need to add site-level Caddy config, edit app.caddy. generated.caddy will be overwritten the next time you run nb env proxy caddy.
If you pass --output, the CLI only writes the generated config to that file and does not additionally create or update app.caddy or the shared main config.
Related configuration items
These CLI configuration items directly affect the generated Caddy output:
Most setups do not need to change proxy.nb-cli-root. You usually need it only when Caddy runs in another container, mount root, or path view.
Notes
--hostis important. Caddy decides whether to manage HTTPS based on the site address. In production, try to pass a domain that already resolves to the current server--portmust be an integer between1and65535- The upstream NocoBase app port comes from the saved env
appPort, not from--port - If the command says the env is missing
appPort, runnb env update <name>first, or explicitly save it withnb env update <name> --app-port <port> - If you change settings such as
app-portorapp-public-pathwithnb env update, you will usually need to rerunnb env proxy caddyafterward --printcannot be combined with--installor--reload--outputcannot be combined with--installor--reload

