You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to find something similar for gofiber on github and google, but the search did not return any results.
I use reverse proxies like nginx and Traefik. It's uses headers X-Forwarded-Host, X-Forwarded-Proto and X-Forwarded-For for pass hostname, protocol and real client ip of original request.
And Trusted Proxies whitelist for describe ip's of reverse proxies on requests from which it is allowed to take values from these headers.
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
4n70w4
changed the title
馃殌 Get c.Hostname() value from X-Forwarded-Host and etc
馃殌 Trusted Reverse Proxy and get c.Hostname() value from X-Forwarded-Host and etc
Apr 26, 2021
Is your feature request related to a problem?
Hi!
I tried to find something similar for gofiber on github and google, but the search did not return any results.
I use reverse proxies like nginx and Traefik. It's uses headers
X-Forwarded-Host
,X-Forwarded-Proto
andX-Forwarded-For
for pass hostname, protocol and real client ip of original request.And Trusted Proxies whitelist for describe ip's of reverse proxies on requests from which it is allowed to take values from these headers.
https://symfony.com/doc/3.2/components/http_foundation/trusting_proxies.html
https://github.com/fideloper/TrustedProxy
Examples:
If request ip in Trusted Proxies whitelist then:
c.Protocol()
get value fromX-Forwarded-Proto
headerc.IP()
get value fromX-Forwarded-For
headerc.Hostname()
get value fromX-Forwarded-Host
headerBut if request ip NOT in Trusted Proxies whitelist then:
c.Protocol()
DON'T get value fromX-Forwarded-Proto
headerc.IP()
DON'T get value fromX-Forwarded-For
headerc.Hostname()
DON'T get value fromX-Forwarded-Host
headerDescribe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: