onyx icon indicating copy to clipboard operation
onyx copied to clipboard

Fix: Correctly route /openapi.json and /api/* paths in Nginx config

Open ThomasRitaine opened this issue 1 year ago • 1 comments

Overview

This PR addresses the routing issue described in #1134, where accessing the /api/docs endpoint failed to load the OpenAPI definition due to an incorrect path for fetching /openapi.json. By updating the Nginx configuration, both the /api/* and /openapi.json paths are now correctly routed, ensuring the documentation UI functions as expected.

Changes

  • Modified the Nginx configuration to match both /api/* and /openapi.json with a single rule.
  • Added a rewrite rule for /api prefixed paths to correctly route API requests without affecting the /openapi.json endpoint.

Impact

  • Resolves the documentation UI issue by allowing /api/docs to successfully fetch the OpenAPI definition.
  • Simplifies the routing logic in the Nginx configuration, potentially reducing future maintenance efforts.

Testing

  • Verified that the documentation UI at /api/docs correctly loads the OpenAPI schema.
  • Confirmed that API routes are unaffected by the new Nginx configuration rule.

Closes #1134

ThomasRitaine avatar Feb 27 '24 10:02 ThomasRitaine

Someone is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 27 '24 10:02 vercel[bot]

Thanks a ton for this contribution!

Weves avatar Mar 01 '24 00:03 Weves