We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.12.0
No response
18.12.1
macOS
13.1
I cannot set trustProxy to true when starting my fastify server with fastify-cli.
module.exports = { trustProxy: true, port: 3300 }
then run it with:
fastify start -l warn --config config.js dist/App.js
TRUST_PROXY=TRUE
TRUST_PROXY=true
and also
TRUST_PROXY=1
TRUST_PROXY=true fastify start -l warn dist/App.js
And all other variations ( TRUE, 1, true )
None of them are setting trustProxy to true, I tested it. The only way it works is by creating the server manually:
const app = Fastify({ trustProxy: true, logger: { level: "info" } });
I expected at least one of them to work, the env file or config.js
The text was updated successfully, but these errors were encountered:
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
Sorry, something went wrong.
Let me try it
hei @alexandrucancescu I resolve that in #654
Successfully merging a pull request may close this issue.
Prerequisites
Fastify version
4.12.0
Plugin version
No response
Node.js version
18.12.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.1
Description
I cannot set trustProxy to true when starting my fastify server with fastify-cli.
Steps to Reproduce
1. Use config.js
then run it with:
2. .env file
TRUST_PROXY=TRUE
TRUST_PROXY=true
and also
TRUST_PROXY=1
3. Pass env variable
And all other variations ( TRUE, 1, true )
None of them are setting trustProxy to true, I tested it. The only way it works is by creating the server manually:
Expected Behavior
I expected at least one of them to work, the env file or config.js
The text was updated successfully, but these errors were encountered: