From 1a6cbf6dcb36563b506c876ff6059640e38be5f0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 30 Mar 2020 16:07:17 +0200 Subject: [PATCH] Add proxy support --- src/helpers/ConfigHelper.ts | 1 + src/main.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/helpers/ConfigHelper.ts b/src/helpers/ConfigHelper.ts index 9f1d069..986c7b8 100644 --- a/src/helpers/ConfigHelper.ts +++ b/src/helpers/ConfigHelper.ts @@ -20,6 +20,7 @@ export interface Configuration { storageURL : string, storagePath : string, database : DatabaseConfiguration, + proxy ?: string } export class ConfigurationHelper { diff --git a/src/main.ts b/src/main.ts index 2dd6240..cef3d0e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -30,6 +30,12 @@ async function init() { app.use(fileUpload()); + // Check if the server is running behing a proxy + if(conf().proxy) { + console.info("Running behind proxy: " + conf().proxy); + app.set("trust proxy", conf().proxy); + } + // Process the list of routes Routes.forEach(route => {