add trust proxy
This commit is contained in:
parent
2a873f38eb
commit
b06287428c
|
@ -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=
|
4
index.js
4
index.js
|
@ -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'));
|
||||||
|
|
Loading…
Reference in New Issue