add trust proxy

This commit is contained in:
b1ek 2023-04-18 10:53:27 +10:00
parent 2a873f38eb
commit b06287428c
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 8 additions and 0 deletions

View File

@ -9,3 +9,7 @@ ADMIN_EMAIL=john.doe@example.com
SESSION_SECRET= SESSION_SECRET=
SESSION_MEMCACHE_HOST=memcache:11211 SESSION_MEMCACHE_HOST=memcache:11211
RATE_LIMIT=
TRUST_PROXY=

View File

@ -11,6 +11,10 @@ const app = express();
const routes = require('./routes'); const routes = require('./routes');
const middleware = require('./middleware'); const middleware = require('./middleware');
if (process.env.TRUST_PROXY != undefined) {
app.enable('trust proxy', '*');
}
app.use(middleware); app.use(middleware);
app.use(routes); app.use(routes);
app.use(express.static('public')); app.use(express.static('public'));