Prerequisites
Fastify version
4.12.0
Node.js version
18.12.1
Operating system
macOS
Description
I cannot set trustProxy to true when starting my fastify server with fastify-cli.
Steps to Reproduce
-
Use config.js:
\\javascript
module.exports = {
trustProxy: true,
port: 3300
}
\
then run: \astify start -l warn --config config.js dist/App.js\
-
Use .env file:
\TRUST_PROXY=true\ or \TRUST_PROXY=1\
-
Pass env variable:
\TRUST_PROXY=true fastify start -l warn dist/App.js\
None of them are setting trustProxy to true. The only way it works is by creating the server manually with trustProxy: true in code.
Expected Behavior
I expected at least one of them to work, the env file or config.js
Prerequisites
Fastify version
4.12.0
Node.js version
18.12.1
Operating system
macOS
Description
I cannot set trustProxy to true when starting my fastify server with fastify-cli.
Steps to Reproduce
Use config.js:
\\javascript
module.exports = {
trustProxy: true,
port: 3300
}
\
then run: \astify start -l warn --config config.js dist/App.js\
Use .env file:
\TRUST_PROXY=true\ or \TRUST_PROXY=1\
Pass env variable:
\TRUST_PROXY=true fastify start -l warn dist/App.js\
None of them are setting trustProxy to true. The only way it works is by creating the server manually with trustProxy: true in code.
Expected Behavior
I expected at least one of them to work, the env file or config.js