Skip to content

Commit

Permalink
Trust all remote proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed Sep 28, 2024
1 parent 62a6391 commit b2bc757
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/symfony/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Add the following lines to `config/packages/framework.yaml`:
```yml filename="config/packages/framework.yaml" {2-5}
framework:
# trust the remote address because API Gateway has no fixed IP or CIDR range that we can target
trusted_proxies: '127.0.0.1'
trusted_proxies: '127.0.0.1, 0.0.0.0/0'
# trust "X-Forwarded-*" headers coming from API Gateway
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-proto', 'x-forwarded-port' ]
```
Expand Down
1 change: 1 addition & 0 deletions docs/use-cases/websites.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ serverless plugin install -n serverless-lift
Because this construct sets the `X-Forwarded-Host` header by default, you should add it in your `trusted_headers` config, otherwise Symfony might generate wrong URLs.

```yml filename="config/packages/framework.yaml" /, 'x-forwarded-host'/
trusted_proxies: '127.0.0.1, 0.0.0.0/0'
trusted_headers: [ 'x-forwarded-for', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-host' ]
```
Expand Down

0 comments on commit b2bc757

Please sign in to comment.