Skip to content

Commit

Permalink
πŸ“– add section on Trust Proxy configuration in dotenv.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrojreis authored and danny-avila committed Feb 20, 2025
1 parent 9a2125f commit b2c5389
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pages/docs/configuration/dotenv.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ For more info see:
]}
/>

### Trust proxy
Use the address that is at most n number of hops away from the Express application.
req.socket.remoteAddress is the first hop, and the rest are looked for in the X-Forwarded-For header from right to left.
A value of 0 means that the first untrusted address would be req.socket.remoteAddress, i.e. there is no reverse proxy.
The `TRUST_PROXY` environment variable default is set to `1`.

Refer to [Express.js - trust proxy](https://expressjs.com/en/guide/behind-proxies.html) for more information about this.

<OptionTable
options={[
['TRUST_PROXY', 'number', 'Specifies the number of hops.', 'HOST=1'],
]}
/>

### Static File Handling

<OptionTable
Expand Down

0 comments on commit b2c5389

Please sign in to comment.