Merge pull request #11 from L1ghtman2k/add_option_to_trust_reverse_proxy

adds optional env variable to trust proxy
This commit is contained in:
BobTheBob 2021-12-30 17:44:09 +00:00 committed by GitHub
commit fdc97329e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -8,3 +8,4 @@ REQUIRE_SESSION_TOKEN=
# not used for dev
SSL_KEY_PATH=
SSL_CERT_PATH=
TRUST_PROXY=

View File

@ -15,13 +15,15 @@ if ( process.env.USE_HTTPS )
https: {
key: fs.readFileSync( process.env.SSL_KEY_PATH ),
cert: fs.readFileSync( process.env.SSL_CERT_PATH )
}
},
trustProxy: !!(process.env.TRUST_PROXY)
})
}
else
{
fastify = fastify({
logger: process.env.USE_FASTIFY_LOGGER || false,
trustProxy: !!(process.env.TRUST_PROXY)
})
}