From 5bb958a3780a4b83c45af987c7bc91e796cf0e1c Mon Sep 17 00:00:00 2001 From: Julio Colon Date: Mon, 7 Apr 2025 14:06:59 -0400 Subject: [PATCH] Update app.js Added use proxy as the code works well on development, using in production behind an Azure LB with secure: true fails. --- App/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/App/app.js b/App/app.js index 7ba1c61..de87511 100644 --- a/App/app.js +++ b/App/app.js @@ -19,6 +19,9 @@ var authRouter = require('./routes/auth'); // initialize express var app = express(); +// Use 1 (true) to trust the first proxy (for example, Azure's load balancer and using secure: true) +app.set('trust proxy', 0); + /** * Using express-session middleware for persistent user session. Be sure to * familiarize yourself with available options. Visit: https://www.npmjs.com/package/express-session