Most secure trustProxy value for a local reverse proxy?
- Dominant language
- No language data
- Stars
- 68
- Forks
- 8
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 2
Description
## 💬 Question here
The fastify service is listening on localhost and on the same server the reverse proxy listens externally on ports 80/443.
Since the fastify service isn't listening to external requests I think setting `trustProxy` to `true` *should* be safe. But I prefer using the strictest settings possible, better to do so and never need it than to not do so and regret it after it's too late.
What would that strictest setting be? To me it looks like it would be `"localhost"` based on the docs but will that cause any issues? Is it actually the strictest value that will work?
## Your Environment
- *node version*: 22
- *fastify version*: >=5.0.0
- *os*: Linux
Contributor guide
Assessment
This issue has not been assessed yet.