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'));