| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- # global-api-01.smartbotics.ai - the CUSTOMER-FACING hostname for
- # smartbotic-vectorapi. The old name (qdrant-1.shop.static.shopcall.ai, mount
- # /rag/) is unchanged and keeps working; this is an addition, not a move.
- #
- # It serves the API AND NOTHING ELSE. No docs page, no openapi.json, no
- # llms.txt, no admin web UI. Those were briefly whitelisted here and were
- # removed deliberately: customers do not need a self-service catalogue of
- # every route, and the docs page published the COMPLETE operation list -
- # admin-only key management, project deletion, the read-only lock and the
- # server-wide stats included - to anyone who loaded the URL. None of it was
- # callable without a key, but naming an endpoint is already a hint, and a
- # published list is also a published list of what to come back and try.
- # When an API is shared with a customer, send them the exact URL plus
- # minimal docs for the part they actually use.
- #
- # A WHITELIST, not a deny-list on `/`. The difference matters on the day a
- # later vectorapi release adds a route: with a whitelist it is absent here
- # until someone decides otherwise, with a deny-list it is exposed the moment
- # the package is upgraded, and nobody would notice. The cost is that a new
- # PUBLIC route has to be added here deliberately - which is the point.
- #
- # TLS is added by certbot --nginx against this block; the cert covers this name
- # only. Do NOT point it at the qdrant-1 certificate, which does not include
- # this hostname and would fail verification in every client.
- server {
- server_name global-api-01.smartbotics.ai;
- access_log /var/log/nginx/access.log timing;
- # Branded error pages for the errors nginx itself raises. See the snippet:
- # proxied responses keep their JSON envelope, which must not change.
- include /etc/nginx/snippets/branded-errors.conf;
- # The API itself. Authentication is vectorapi's: every /api/* path is
- # authenticated BEFORE routing, so an unknown path answers 401 rather than
- # 404 and nginx need not know the route table.
- location /api/ {
- proxy_pass http://127.0.0.1:8080;
- include /etc/nginx/snippets/vectorapi-proxy.conf;
- }
- # Liveness, kept so this hostname can be monitored from outside without a
- # credential. NOT under /api/, which is the trap worth knowing: a probe of
- # /api/v1/healthz answers 401 unauthenticated and 404 WITH a valid key,
- # because pre-routing auth runs before the route table. Verified it returns
- # {"status":"ok"} and nothing else - no version, nothing to disclose. That
- # is the whole reason it is still here while the docs are not.
- location = /healthz {
- proxy_pass http://127.0.0.1:8080;
- include /etc/nginx/snippets/vectorapi-proxy.conf;
- }
- # Everything else is absent on this hostname: the admin web UI, the docs
- # page and its asset, /openapi.json and /llms.txt. All of it stays
- # reachable on the old name under /rag/, which is where we read it.
- # 404 rather than 403: a 403 would confirm something is there.
- # Published HTTP functions, served to the world at /fn/{project}/*.
- #
- # Added 2026-10-22, deliberately AFTER vectorapi 0.16.0 was deployed and not
- # before. This route is unauthenticated BY DESIGN - a published function is
- # published - and until 0.16.0 it was also UNTHROTTLED, because the limiter
- # charge and `auth: 'key'` only landed in 0.15.0, which was never published.
- # Measured on prod before the upgrade: an anonymous POST with no credential
- # answered 200 in 0.106s. Adding this location then would have duplicated an
- # unbounded surface onto the one hostname kept narrow on purpose.
- #
- # It is defensible now because the function's `rate_limit_per_min` is charged
- # on the CALL as well as on its data access, and a descriptor may declare
- # `auth: 'key'` to require a key per caller - verified live: anonymous 401
- # against 200 with a key.
- #
- # NO trailing slash on proxy_pass, so /fn/... reaches vectorapi unchanged.
- # The /rag/ mount on the old hostname DOES strip its prefix; the two are
- # different on purpose. The shared snippet carries the timeouts and body
- # limit so this location cannot drift from /api/.
- location /fn/ {
- proxy_pass http://127.0.0.1:8080;
- include /etc/nginx/snippets/vectorapi-proxy.conf;
- }
- location / {
- return 404;
- }
- listen 443 ssl; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/global-api-01.smartbotics.ai/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/global-api-01.smartbotics.ai/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
- }
- server {
- if ($host = global-api-01.smartbotics.ai) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- server_name global-api-01.smartbotics.ai;
- listen 80;
- return 404; # managed by Certbot
- }
|