@@ -33,13 +33,13 @@ and what headers your reverse proxy uses to send information:
33
33
# ...
34
34
// the IP address (or range) of your proxy
35
35
trusted_proxies: '192.0.0.1,10.0.0.0/8'
36
- // trust *all* "X-Forwarded-*" headers (the ! prefix means to not trust those headers)
37
- trusted_headers: ['x-forwarded-all ', '! x-forwarded-host', '! x-forwarded-prefix ']
36
+ // trust *all* "X-Forwarded-*" headers
37
+ trusted_headers: ['x-forwarded-for ', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port ']
38
38
// or, if your proxy instead uses the "Forwarded" header
39
- trusted_headers: ['forwarded', '!x-forwarded-host', '!x-forwarded-prefix' ]
39
+ trusted_headers: ['forwarded']
40
40
// or, if you're using a wellknown proxy
41
- trusted_headers: [!php/const Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_AWS_ELB, '!x-forwarded-host', '!x-forwarded-prefix' ]
42
- trusted_headers: [!php/const Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_TRAEFIK, '!x-forwarded-host', '!x-forwarded-prefix' ]
41
+ trusted_headers: [!php/const Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_AWS_ELB]
42
+ trusted_headers: [!php/const Symfony\\Component\\HttpFoundation\\Request::HEADER_X_FORWARDED_TRAEFIK]
43
43
44
44
.. code-block:: xml
45
45
@@ -57,15 +57,14 @@ and what headers your reverse proxy uses to send information:
57
57
<!-- the IP address (or range) of your proxy -->
58
58
<framework:trusted-proxies>192.0.0.1,10.0.0.0/8</framework:trusted-proxies>
59
59
60
- <!-- trust *all* "X-Forwarded-*" headers (the ! prefix means to not trust those headers) -->
61
- <framework:trusted-header>x-forwarded-all</framework:trusted-header>
62
- <framework:trusted-header>!x-forwarded-host</framework:trusted-header>
63
- <framework:trusted-header>!x-forwarded-prefix</framework:trusted-header>
60
+ <!-- trust *all* "X-Forwarded-*" headers -->
61
+ <framework:trusted-header>x-forwarded-for</framework:trusted-header>
62
+ <framework:trusted-header>x-forwarded-host</framework:trusted-header>
63
+ <framework:trusted-header>x-forwarded-proto</framework:trusted-header>
64
+ <framework:trusted-header>x-forwarded-port</framework:trusted-header>
64
65
65
66
<!-- or, if your proxy instead uses the "Forwarded" header -->
66
67
<framework:trusted-header>forwarded</framework:trusted-header>
67
- <framework:trusted-header>!x-forwarded-host</framework:trusted-header>
68
- <framework:trusted-header>!x-forwarded-prefix</framework:trusted-header>
69
68
</framework:config>
70
69
</container>
71
70
@@ -78,12 +77,12 @@ and what headers your reverse proxy uses to send information:
78
77
// the IP address (or range) of your proxy
79
78
'trusted_proxies' => '192.0.0.1,10.0.0.0/8',
80
79
// trust *all* "X-Forwarded-*" headers (the ! prefix means to not trust those headers)
81
- 'trusted_headers' => ['x-forwarded-all ', '! x-forwarded-host', '! x-forwarded-prefix '],
80
+ 'trusted_headers' => ['x-forwarded-for ', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port '],
82
81
// or, if your proxy instead uses the "Forwarded" header
83
- 'trusted_headers' => ['forwarded', '!x-forwarded-host', '!x-forwarded-prefix' ],
82
+ 'trusted_headers' => ['forwarded'],
84
83
// or, if you're using a wellknown proxy
85
- 'trusted_headers' => [Request::HEADER_X_FORWARDED_AWS_ELB, '!x-forwarded-host', '!x-forwarded-prefix' ],
86
- 'trusted_headers' => [Request::HEADER_X_FORWARDED_TRAEFIK, '!x-forwarded-host', '!x-forwarded-prefix' ],
84
+ 'trusted_headers' => [Request::HEADER_X_FORWARDED_AWS_ELB],
85
+ 'trusted_headers' => [Request::HEADER_X_FORWARDED_TRAEFIK],
87
86
]);
88
87
89
88
.. deprecated:: 5.2
0 commit comments