Reverse Proxy for Production
In NocoBase CLI, there are two recommended entry points for putting a reverse proxy in front of a production app:
nb env proxy nginxnb env proxy caddy
As long as your app has already been saved as a CLI env and the env type is local or docker, letting the CLI generate the config is usually enough. That way, the CLI keeps tricky details such as WebSocket handling, subpaths, SPA fallback pages, and later updates in sync. You only need to decide whether the entry layer should keep using Nginx or move to Caddy.
If your app is not managed by the CLI, or if you explicitly want to handwrite the full proxy config, go straight to the handwritten-config section in the provider pages.
Check whether this path fits your setup
- Your app is already reachable through an internal address such as
http://127.0.0.1:13000 - The app has already been saved as a CLI env, and the env type is
localordocker - The env already has
appPortsaved
If the command says the env is missing appPort, run nb env update first and save it.
If you later change settings such as app-port or app-public-path that affect proxy output, remember to rerun the matching proxy subcommand.
Default path: let the CLI generate the config first
If you already know which entry provider you want to keep using, go straight to that subcommand:
If you have already switched to the current env, you can also omit --env:
Where:
- If you already use Nginx to manage sites, caching, access control, or certificates, start with
nb env proxy nginx - If you want HTTPS running quickly and do not want to maintain many TLS details yourself, start with
nb env proxy caddy --portis the proxy entry port, not the appappPort
If you want the CLI to also connect the shared config to the provider main config and reload it after validation, add:
For the full command reference, see nb env proxy.
What the CLI keeps in sync for you
The CLI does more than generate one proxy snippet. It also maintains provider-specific helper files. The output shape differs between the two providers:
- Nginx keeps
app.conf,public/index-v1.html,public/index-v2.html, the sharednocobase.conf, and the sharedsnippets/ - Caddy keeps
generated.caddy,app.caddy, and the sharednocobase.caddy
If you need to add site-level configuration, edit app.conf or app.caddy. Do not manually edit CLI-managed helper files, because they will be overwritten the next time you run the command.
Which page should you open first
When the CLI-generated path is not the best fit
These cases are usually better served by the handwritten-config section in the provider pages:
- Your app is not managed by the CLI
- The env only has a remote API connection, or it is an SSH env
- You explicitly want to maintain the full Nginx config or full
Caddyfileyourself
As long as the app has already been saved as a CLI env and the current machine can reach its runtime, the default recommendation is still to start with these commands. It makes later domain changes, site-level adjustments, and regeneration much easier to manage.

