Hi Bryan,
It could have been caused by CDN, reverse proxy or just clients using weird proxy setting wrong headers. This is an example of the module we are using when the website is behind the proxy to extract real IP from X-Forwarded-For header:
[assembly: RegisterModule(typeof(UserIpFromHeaderModule))]
namespace Custom.Modules
{
public class UserIpFromHeaderModule : Module
{
public UserIpFromHeaderModule() : base("Custom.Modules.IpFromHeader")
{
}
protected override void OnInit()
{
base.OnInit();
RequestEvents.Begin.Execute += this.GetRealClientIpAddress;
}
void GetRealClientIpAddress(object sender, EventArgs e)
{
if ((HttpContext.Current != null) && (HttpContext.Current.Request != null))
{
var headers = HttpContext.Current.Request.Headers;
// Look for the special header variable that the firewall or load balancer passes
var realIp = headers.Get("X-Forwarded-For");
if (!string.IsNullOrWhiteSpace(realIp) && !string.Equals(realIp, "::1", StringComparison.OrdinalIgnoreCase))
{
// If there are multiple addresses in header
if (realIp.Contains(","))
realIp = realIp.Split(',')[0].Trim();
// Remove port if presented
if (realIp.Contains(":"))
realIp = realIp.Split(':')[0].Trim();
RequestContext.UserHostAddress = realIp;
}
}
}
}
}
Perhaps in addition to this logic you can check RequestContext.UserHostAddress and trim starting from "," symbol so that the header contains a single IP address.