-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement proper hop-to-hop + forwarded headers #2202
Comments
Missing |
However, We need to keep in mind a couple things with
Proposed solution: As stated before, those
|
* Introduce trusted_ips config property * Introduce real_ip_header * New lua-resty-mediador * Implement logic to validate client ips as trusted * Implement Lua logic for the X-Forwarded-For upstream header * Related tests (renamed real_ip test suite to upstream_headers) Fix #2202
* Introduce trusted_ips config property * Introduce real_ip_header * New lua-resty-mediador * Implement logic to validate client ips as trusted * Implement Lua logic for the X-Forwarded-For upstream header * Related tests (renamed real_ip test suite to upstream_headers) Fix #2202
Thanks for the work, it would be great to see that in 0.10.2 as not forwarding |
* Introduce trusted_ips config property * Introduce real_ip_header * New lua-resty-mediador * Implement logic to validate client ips as trusted * Implement Lua logic for the X-Forwarded-For upstream header * Move the WebSocket upstream headers dance to the Lua-land instead of the old Nginx maps. * Related tests (renamed real_ip test suite to upstream_headers) Fix #2202
Confirmed working with 0.11.0rc2 with trusted_ips 👍 Made my job easier. Thanks! |
As a reverse proxy, Kong needs to forward the appropriate headers from trusted sources.
X-Real-IP
with the value from$realip_remote_addr
.X-Forwarded-For
: the value from$proxy_add_x_forwarded_for
.X-Forwarded-Proto
: forwarded if present, use$scheme
otherwise.X-Forwarded-Host
: forward if present, use request Host header otherwise.X-Forwarded-Port
: forward if present, use$server_port
otherwise.Date:
header back to client withproxy_pass_header Date;
.set_real_ip_from
directive innginx_kong.conf
template fromkong.conf
.real_ip_from
fromkong.conf
.real_ip_recursive
directive innginx_kong.conf
template fromkong.conf
.X-Forwarded-Proto
header if the client IP is part of theset_real_ip_from
CIDR blocks. Use lua-resty-iputils for this if we don't find a way to do it from the Nginx config level.I have pushed my current work on
feat/real-hop-to-hop
with work and tests already done, and checked the already-implemented features.This gathers:
#1662
#1788
#1896
#1823
#1445
#1762
#1661
And maybe others.
@bungle has stepped forward to finish this.
The text was updated successfully, but these errors were encountered: