Project

General

Profile

Actions

Feature #56657

open

rgw/beast: Keep remote_addr from the incoming connection if there is no x-forwarded-for info

Added by Christian Rohmann over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Currently RGW already does allow to determine the actual remote address of a client via a configurable HTTP header using the option rgw_remote_addr_param (https://docs.ceph.com/en/latest/radosgw/config-ref/#confval-rgw_remote_addr_param).
This info then replaces the IP address from the incoming TCP connection in the field remote_addr of the rgw ops log. While this is really great for the common case if RGW is behind a reverse proxy like HAProxy.

Unfortunately the field value is changed to an empty string in case the configured header like, x-forwarded-for, is missing.
In cases where connections are established via the said reverse proxy as well as directly to RGW this then actually "destroys" the info about the remote address.
When using multi-site sync, those connections are sometimes just done between the RGW instances and not via the reverse proxy which only handles regular client connections.

It would be great if the remote address would only be replaced if the header was present and be kept as is otherwise.

No data to display

Actions

Also available in: Atom PDF