From 8f99dbfcc305c97e77eca85408735492996f2f4b Mon Sep 17 00:00:00 2001 From: b1ek Date: Sun, 12 Mar 2023 12:17:24 +1000 Subject: [PATCH] add trust proxy --- .env.example | 1 + index.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env.example b/.env.example index a8f5074..feb425c 100644 --- a/.env.example +++ b/.env.example @@ -2,6 +2,7 @@ APP_PORT=8000 APP_DEBUG=true # 32-byte base64 string APP_KEY= +TRUST_PROXY=::ffff:10.8.0.1 DB_PORT=5432 DB_HOSTNAME=db diff --git a/index.js b/index.js index e8e33fb..c0aea5d 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,8 @@ const bodyparser = require('body-parser'); const { APP_PORT } = process.env; +app.set('trust proxy', process.env.TRUST_PROXY); + app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: true })); app.use(require('./middleware'));