Skip to content

Fix/nginx proxy and imap routes - #932

Open
onkar0127 wants to merge 3 commits into
Userunknown84:mainfrom
onkar0127:fix/nginx-proxy-and-imap-routes
Open

Fix/nginx proxy and imap routes#932
onkar0127 wants to merge 3 commits into
Userunknown84:mainfrom
onkar0127:fix/nginx-proxy-and-imap-routes

Conversation

@onkar0127

@onkar0127 onkar0127 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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 Found errors.

This occurred due to two separate routing bugs:

  1. Nginx Missing Locations: The production nginx.conf did not have location blocks for several root-level backend endpoints, causing Nginx to fall back to serving index.html instead of forwarding the requests to the Express server.
  2. Incorrect IMAP Mount Path: The frontend initiates Email Scanner API requests with the /imap/ prefix (e.g. /imap/scan-now, /imap/connect). However, in server.js, imapRoutes was mounted on root /, causing Express to return 404s for /imap/... requests.

Key Changes

1. Added Reverse-Proxy Locations in Nginx

  • File: frontend/nginx.conf
  • Added reverse-proxy mapping blocks for all missing root-level backend endpoints to ensure they are successfully forwarded to the backend container:
    • /gmail
    • /outlook
    • /scan-emails
    • /analyze-email-header
    • /bulk-predict
    • /spam-insights
    • /imap

2. Mapped imapRoutes to Correct Path

  • File: backend/server.js
  • Corrected the mount path for imapRoutes from app.use("/", imapRoutes) to app.use("/imap", imapRoutes) to align with the frontend Axios calls.

Verification and Testing

  • Checked the Node.js backend compilation to ensure server.js starts cleanly with the revised route mappings.
  • Verified that Nginx reverse-proxy routes cover all required dashboard features.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Missing proxy routes in Docker Nginx config breaks multiple features in production

1 participant