|
@@ -24,6 +24,7 @@
|
|
|
# this hostname and would fail verification in every client.
|
|
# this hostname and would fail verification in every client.
|
|
|
server {
|
|
server {
|
|
|
server_name global-api-01.smartbotics.ai;
|
|
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:
|
|
# Branded error pages for the errors nginx itself raises. See the snippet:
|
|
|
# proxied responses keep their JSON envelope, which must not change.
|
|
# proxied responses keep their JSON envelope, which must not change.
|
|
@@ -52,6 +53,30 @@ server {
|
|
|
# page and its asset, /openapi.json and /llms.txt. All of it stays
|
|
# 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.
|
|
# reachable on the old name under /rag/, which is where we read it.
|
|
|
# 404 rather than 403: a 403 would confirm something is there.
|
|
# 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 / {
|
|
location / {
|
|
|
return 404;
|
|
return 404;
|
|
|
}
|
|
}
|