Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

ThomasRitaine
Copy link

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

Copy link

vercel bot commented Feb 27, 2024

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

A member of the Team first needs to authorize it.

@Weves Weves merged commit 8621523 into danswer-ai:main Mar 1, 2024
1 check failed
@Weves
Copy link
Contributor

Weves commented Mar 1, 2024

Thanks a ton for this contribution!

@ThomasRitaine ThomasRitaine deleted the fix/openapi-file-path branch March 1, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation Endpoint /api/docs Fails to Load OpenAPI Definition
2 participants