# nginx config for the prod reverse proxy A **copy of what is running on the prod droplet**, kept here so it is reviewable and recoverable. Nothing in this directory is deployed by the build or by any package: editing a file here changes nothing until it is copied to the host. The host is the source of truth; this is the backup and the review surface. ## What is here | file | installed as | |---|---| | `global-api-01.smartbotics.ai.conf` | `/etc/nginx/sites-available/global-api-01.smartbotics.ai` (symlinked into `sites-enabled`) | | `vectorapi-proxy.conf` | `/etc/nginx/snippets/vectorapi-proxy.conf` | | `branded-errors.conf` | `/etc/nginx/snippets/branded-errors.conf` | | `errors/_brand/*` | `/var/www/smartbotics-errors/_brand/` | | `qdrant-1.shop.static.shopcall.ai.conf` | `/etc/nginx/sites-available/qdrant-1.shop.static.shopcall.ai` | | `smartbotics-catchall.conf` | `/etc/nginx/sites-available/smartbotics-catchall` | The old hostname also fronts **qdrant** on `142.93.100.6:6334`, which has nothing to do with this service, so change it on the host with that in mind. ## NEVER EDIT A PACKAGE CONFFILE `/etc/nginx/sites-available/default` belongs to **nginx-common** and is a dpkg CONFFILE. Editing it makes every later nginx upgrade stop and ask about a three-way merge, which is how a cosmetic change becomes an interactive prompt in the middle of an unattended upgrade. It was edited here once and restored; `dpkg --verify nginx-common` is the check, and it must print nothing. So the catch-all lives in `smartbotics-catchall`, which no package owns, and the packaged `default` is left byte-for-byte as shipped and simply not symlinked into `sites-enabled`. `/var/www/html/index.nginx-debian.html` is the same story: still on disk, never served. Before changing anything under `/etc/nginx`, run `dpkg -S ` and put the change in a file of our own if a package answers. All four server blocks across those two files include `branded-errors.conf`, so every nginx-raised error on this box is branded. Verified afterwards that qdrant still answers its own JSON on 6334 and that `/rag/` is untouched. ## The two things worth reading before editing **The customer-facing host is a WHITELIST.** Only `/api/` and `/healthz` are proxied; everything else answers 404, the admin web UI and the docs included. A deny-list would expose whatever a later release adds, the moment the package upgrades, with nobody noticing. Adding a route here is meant to be a decision. **`proxy_intercept_errors` must stay off.** The branded pages are for the errors nginx itself raises. With interception on, vectorapi's own JSON error envelope would be replaced by HTML and every client parsing it would break. ## Applying a change scp packaging/nginx/branded-errors.conf prod:/tmp/ ssh prod 'sudo cp /tmp/branded-errors.conf /etc/nginx/snippets/ && sudo nginx -t && sudo systemctl reload nginx' Then verify from OUTSIDE, and not in the same breath as the reload: the first request after a reload can land on the old worker set and answer 404, which reads exactly like a broken location block.