nb env proxy nginx
nb env proxy nginx generates Nginx proxy config files and helper files for one CLI-managed env. It fits these cases well: you already use Nginx to manage sites, or you still want to manage certificates, caching, or access control 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
nb env proxy nginx maintains these files under ~/.nocobase/proxy/nginx/:
Where:
app.confis editable, but you should keep the managed block between# BEGIN NocoBase managed configand# END NocoBase managed configindex-v1.htmlandindex-v2.htmlautomatically rewrite asset URLs according to the current env subpath, active client version, andCDN_BASE_URLnocobase.confis mainly used by--install- Files under
public/andsnippets/are usually not meant to be edited manually and will be resynced the next time you run the command
If you need to add site-level Nginx config, edit app.conf. Do not manually edit managed files under public/ or snippets/, because they will be overwritten the next time you run nb env proxy nginx.
Related configuration items
These CLI configuration items directly affect the generated Nginx output:
Most setups do not need to change proxy.nb-cli-root. You usually need it only when Nginx runs in another container, mount root, or path view.
Notes
--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 nginxafterward --printcannot be combined with--installor--reload- The Nginx provider does not support
--output

