-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reverseproxy: Implement trusted proxies for
X-Forwarded-*
headers (#…
- Loading branch information
1 parent
d058dee
commit c50094f
Showing
3 changed files
with
243 additions
and
23 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
caddytest/integration/caddyfile_adapt/reverse_proxy_trusted_proxies.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
:8884 | ||
|
||
reverse_proxy 127.0.0.1:65535 { | ||
trusted_proxies 127.0.0.1 | ||
} | ||
|
||
reverse_proxy 127.0.0.1:65535 { | ||
trusted_proxies private_ranges | ||
} | ||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":8884" | ||
], | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "reverse_proxy", | ||
"trusted_proxies": [ | ||
"127.0.0.1" | ||
], | ||
"upstreams": [ | ||
{ | ||
"dial": "127.0.0.1:65535" | ||
} | ||
] | ||
}, | ||
{ | ||
"handler": "reverse_proxy", | ||
"trusted_proxies": [ | ||
"192.168.0.0/16", | ||
"172.16.0.0/12", | ||
"10.0.0.0/8", | ||
"127.0.0.1/8", | ||
"fd00::/8", | ||
"::1" | ||
], | ||
"upstreams": [ | ||
{ | ||
"dial": "127.0.0.1:65535" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters