global-api-01.smartbotics.ai.conf 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # global-api-01.smartbotics.ai - the CUSTOMER-FACING hostname for
  2. # smartbotic-vectorapi. The old name (qdrant-1.shop.static.shopcall.ai, mount
  3. # /rag/) is unchanged and keeps working; this is an addition, not a move.
  4. #
  5. # It serves the API AND NOTHING ELSE. No docs page, no openapi.json, no
  6. # llms.txt, no admin web UI. Those were briefly whitelisted here and were
  7. # removed deliberately: customers do not need a self-service catalogue of
  8. # every route, and the docs page published the COMPLETE operation list -
  9. # admin-only key management, project deletion, the read-only lock and the
  10. # server-wide stats included - to anyone who loaded the URL. None of it was
  11. # callable without a key, but naming an endpoint is already a hint, and a
  12. # published list is also a published list of what to come back and try.
  13. # When an API is shared with a customer, send them the exact URL plus
  14. # minimal docs for the part they actually use.
  15. #
  16. # A WHITELIST, not a deny-list on `/`. The difference matters on the day a
  17. # later vectorapi release adds a route: with a whitelist it is absent here
  18. # until someone decides otherwise, with a deny-list it is exposed the moment
  19. # the package is upgraded, and nobody would notice. The cost is that a new
  20. # PUBLIC route has to be added here deliberately - which is the point.
  21. #
  22. # TLS is added by certbot --nginx against this block; the cert covers this name
  23. # only. Do NOT point it at the qdrant-1 certificate, which does not include
  24. # this hostname and would fail verification in every client.
  25. server {
  26. server_name global-api-01.smartbotics.ai;
  27. # Branded error pages for the errors nginx itself raises. See the snippet:
  28. # proxied responses keep their JSON envelope, which must not change.
  29. include /etc/nginx/snippets/branded-errors.conf;
  30. # The API itself. Authentication is vectorapi's: every /api/* path is
  31. # authenticated BEFORE routing, so an unknown path answers 401 rather than
  32. # 404 and nginx need not know the route table.
  33. location /api/ {
  34. proxy_pass http://127.0.0.1:8080;
  35. include /etc/nginx/snippets/vectorapi-proxy.conf;
  36. }
  37. # Liveness, kept so this hostname can be monitored from outside without a
  38. # credential. NOT under /api/, which is the trap worth knowing: a probe of
  39. # /api/v1/healthz answers 401 unauthenticated and 404 WITH a valid key,
  40. # because pre-routing auth runs before the route table. Verified it returns
  41. # {"status":"ok"} and nothing else - no version, nothing to disclose. That
  42. # is the whole reason it is still here while the docs are not.
  43. location = /healthz {
  44. proxy_pass http://127.0.0.1:8080;
  45. include /etc/nginx/snippets/vectorapi-proxy.conf;
  46. }
  47. # Everything else is absent on this hostname: the admin web UI, the docs
  48. # page and its asset, /openapi.json and /llms.txt. All of it stays
  49. # reachable on the old name under /rag/, which is where we read it.
  50. # 404 rather than 403: a 403 would confirm something is there.
  51. location / {
  52. return 404;
  53. }
  54. listen 443 ssl; # managed by Certbot
  55. ssl_certificate /etc/letsencrypt/live/global-api-01.smartbotics.ai/fullchain.pem; # managed by Certbot
  56. ssl_certificate_key /etc/letsencrypt/live/global-api-01.smartbotics.ai/privkey.pem; # managed by Certbot
  57. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  58. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  59. }
  60. server {
  61. if ($host = global-api-01.smartbotics.ai) {
  62. return 301 https://$host$request_uri;
  63. } # managed by Certbot
  64. server_name global-api-01.smartbotics.ai;
  65. listen 80;
  66. return 404; # managed by Certbot
  67. }