From b06287428c67e74c709b87b5806f751ba1951129 Mon Sep 17 00:00:00 2001 From: b1ek Date: Tue, 18 Apr 2023 10:53:27 +1000 Subject: [PATCH] add trust proxy --- .env.example | 4 ++++ index.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.env.example b/.env.example index 270b5d3..d25ac6b 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,7 @@ ADMIN_EMAIL=john.doe@example.com SESSION_SECRET= SESSION_MEMCACHE_HOST=memcache:11211 + +RATE_LIMIT= + +TRUST_PROXY= \ No newline at end of file diff --git a/index.js b/index.js index 67e003a..18c3cbf 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,10 @@ const app = express(); const routes = require('./routes'); const middleware = require('./middleware'); +if (process.env.TRUST_PROXY != undefined) { + app.enable('trust proxy', '*'); +} + app.use(middleware); app.use(routes); app.use(express.static('public'));