From 31df5a4aa02a0e7eab13b0116f7e60019ae651af Mon Sep 17 00:00:00 2001 From: Debian Date: Mon, 30 Mar 2026 16:36:59 +0000 Subject: [PATCH] . --- apps/api/src/lib/http.ts | 1 + ecosystem.config.cjs | 22 ++++++++++++++++++++++ infra/nginx/default.conf | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ecosystem.config.cjs diff --git a/apps/api/src/lib/http.ts b/apps/api/src/lib/http.ts index 2b827c3..7eebf21 100644 --- a/apps/api/src/lib/http.ts +++ b/apps/api/src/lib/http.ts @@ -43,6 +43,7 @@ export const assertAllowedOrigin = (request: Request): void => { return; } + console.log(config.appOrigins, origin) if (!config.appOrigins.includes(origin.toLowerCase())) { throw new HttpError(403, "Origin is not allowed."); } diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs new file mode 100644 index 0000000..8de8342 --- /dev/null +++ b/ecosystem.config.cjs @@ -0,0 +1,22 @@ +const path = require("node:path"); + +module.exports = { + apps: [ + { + name: "internal-mailserver", + cwd: path.join(__dirname, "apps/api"), + script: "bun", + args: "--env-file ../../.env dist/index.js", + interpreter: "none", + exec_mode: "fork", + instances: 1, + autorestart: true, + watch: false, + time: true, + max_memory_restart: "512M", + env: { + NODE_ENV: "production" + } + } + ] +}; diff --git a/infra/nginx/default.conf b/infra/nginx/default.conf index 18611e2..a441c49 100644 --- a/infra/nginx/default.conf +++ b/infra/nginx/default.conf @@ -5,7 +5,7 @@ server { client_max_body_size 2m; location / { - proxy_pass http://127.0.0.1:3001; + proxy_pass http://127.0.0.1:16731; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;