diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 74eccd1..caa6fe2 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -140,6 +140,22 @@ http { proxy_set_header Host $host; } + # Dedicated /openapi.json block — must come before catch-all / + # LiteLLM serves valid openapi: 3.1.0 JSON at this path internally, + # but the catch-all location / strips the URI path. This block + # preserves the full path so the spec JSON is returned instead of + # the Swagger UI SPA HTML. + location /openapi.json { + proxy_pass $litellm_backend_url/openapi.json; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Authorization $http_authorization; + proxy_connect_timeout 10s; + proxy_read_timeout 600s; + proxy_buffering off; + } + location / { proxy_pass $litellm_backend_url/; proxy_http_version 1.1;