Add VPS deployment guide and production fixes

This commit is contained in:
Shanmuga Krishnan S M
2026-08-03 11:20:35 +05:30
parent fb8bb87c74
commit ab759e37fd
3 changed files with 350 additions and 2 deletions

View File

@@ -27,6 +27,11 @@ export const getBackendUrl = (path: string = ''): string => {
return `${envUrl.endsWith('/') ? envUrl.slice(0, -1) : envUrl}${path}`;
}
const host = window.location.hostname;
const port = window.location.port;
// If running in production behind Nginx reverse proxy (standard port 80/443 or empty)
if (!port || port === '80' || port === '443') {
return path;
}
return `http://${host}:8085${path}`;
};
@@ -36,5 +41,10 @@ export const getChatbotUrl = (path: string = ''): string => {
return `${envUrl.endsWith('/') ? envUrl.slice(0, -1) : envUrl}${path}`;
}
const host = window.location.hostname;
const port = window.location.port;
// If running in production behind Nginx reverse proxy (standard port 80/443 or empty)
if (!port || port === '80' || port === '443') {
return path.startsWith('/api/chat') ? path : `/api/chat${path}`;
}
return `http://${host}:8081${path}`;
};