Fix/nginx proxy and imap routes - #932
Open
onkar0127 wants to merge 3 commits into
Open
Conversation
|
@onkar0127 is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RESOLVES #838
PR Description:
Problem Summary
In production Docker deployments (using Nginx to serve the build and route API requests), multiple features like GMail Scanning, Outlook Scanning, Bulk Predictions, Insights, and Sender Verification returned
404 Not Founderrors.This occurred due to two separate routing bugs:
nginx.confdid not have location blocks for several root-level backend endpoints, causing Nginx to fall back to servingindex.htmlinstead of forwarding the requests to the Express server./imap/prefix (e.g./imap/scan-now,/imap/connect). However, inserver.js,imapRouteswas mounted on root/, causing Express to return 404s for/imap/...requests.Key Changes
1. Added Reverse-Proxy Locations in Nginx
frontend/nginx.conf/gmail/outlook/scan-emails/analyze-email-header/bulk-predict/spam-insights/imap2. Mapped
imapRoutesto Correct Pathbackend/server.jsimapRoutesfromapp.use("/", imapRoutes)toapp.use("/imap", imapRoutes)to align with the frontend Axios calls.Verification and Testing
server.jsstarts cleanly with the revised route mappings.