From f6cb36a9562366194b017a625e55f27919171f42 Mon Sep 17 00:00:00 2001 From: onkar0127 Date: Sun, 19 Jul 2026 10:42:08 +0530 Subject: [PATCH] fix: add Nginx reverse-proxy rules and correct IMAP mount path --- backend/server.js | 2 +- frontend/nginx.conf | 56 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/backend/server.js b/backend/server.js index e078a0bb..fc73f2cc 100644 --- a/backend/server.js +++ b/backend/server.js @@ -271,7 +271,7 @@ app.use('/admin/queues', adminAuth, serverAdapter.getRouter()); app.use("/", predictionRoutes); app.use("/", emailIntegrationRoutes); -app.use("/", imapRoutes); +app.use("/imap", imapRoutes); app.use("/", utilityRoutes); // Versioned routes (v1) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 08897dbf..96a08989 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -40,4 +40,60 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_cache_bypass $http_upgrade; } + + location /gmail { + proxy_pass http://node-backend:3000/gmail; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /outlook { + proxy_pass http://node-backend:3000/outlook; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /scan-emails { + proxy_pass http://node-backend:3000/scan-emails; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /analyze-email-header { + proxy_pass http://node-backend:3000/analyze-email-header; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /bulk-predict { + proxy_pass http://node-backend:3000/bulk-predict; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /spam-insights { + proxy_pass http://node-backend:3000/spam-insights; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } + + location /imap { + proxy_pass http://node-backend:3000/imap; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_cache_bypass $http_upgrade; + } }