<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ProGet Package Download Statistics IP when behind Load Balancer]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">We are running 2x ProGet servers in High Availability behind a load balancer. We are only seeing the load balancer IP on the package download statistics in ProGet.</p>
<p dir="auto">We have enabled X-Forwarded-For on the load balancer to forward on the Client-IP but this has had not had any impact. Is there another header value we should be sending? Apologies if this is documented somewhere, I couldn't find it!</p>
<p dir="auto">Thanks,<br />
Ashely</p>
]]></description><link>https://forums.inedo.com/topic/5744/proget-package-download-statistics-ip-when-behind-load-balancer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 11:41:21 GMT</lastBuildDate><atom:link href="https://forums.inedo.com/topic/5744.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 May 2026 14:56:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ProGet Package Download Statistics IP when behind Load Balancer on Thu, 07 May 2026 14:56:29 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">We are running 2x ProGet servers in High Availability behind a load balancer. We are only seeing the load balancer IP on the package download statistics in ProGet.</p>
<p dir="auto">We have enabled X-Forwarded-For on the load balancer to forward on the Client-IP but this has had not had any impact. Is there another header value we should be sending? Apologies if this is documented somewhere, I couldn't find it!</p>
<p dir="auto">Thanks,<br />
Ashely</p>
]]></description><link>https://forums.inedo.com/post/19648</link><guid isPermaLink="true">https://forums.inedo.com/post/19648</guid><dc:creator><![CDATA[Ashley]]></dc:creator><pubDate>Thu, 07 May 2026 14:56:29 GMT</pubDate></item><item><title><![CDATA[Reply to ProGet Package Download Statistics IP when behind Load Balancer on Fri, 08 May 2026 01:48:37 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://forums.inedo.com/uid/3714">@Ashley</a> ,</p>
<p dir="auto">It sounds like you're definitely looking in the right place / setting the right configuration. X-Forwarded-For should do the trick, but something as silly as a typo (which I've done several times) will make it not work.</p>
<p dir="auto">Here are the settings we recommend:</p>
<pre><code>   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Forwarded-Host $http_host;
   proxy_set_header X-Forwarded-Port $server_port;
</code></pre>
<p dir="auto">And as an FYI, here is the code we use to get the ClientIP adddress.</p>
<pre><code>public static string GetClientIPAddress(this AhHttpRequest request)
{
    ArgumentNullException.ThrowIfNull(request);

    var forwardedFor = request.Headers["X-Forwarded-For"];
    if (!string.IsNullOrWhiteSpace(forwardedFor))
    {
        var ips = forwardedFor.Split(',');
        var clientIp = ips.FirstOrDefault();
        if (!string.IsNullOrWhiteSpace(clientIp))
            return stripIpv4OverIpv6(clientIp.Trim().Truncate(50)!);
    }

    return stripIpv4OverIpv6((request.NativeRequest?.HttpContext?.Connection?.RemoteIpAddress?.ToString() ?? request.UserHostAddress).Truncate(50)!);

    static string stripIpv4OverIpv6(string ip)
    {
        if (ip.StartsWith("::ffff:") &amp;&amp; ip.Contains('.'))
            return ip["::ffff:".Length..];
        return ip;
    }
}
</code></pre>
<p dir="auto">Although I think the <code>stripIpv4OverIpv6</code> bits may be relatively new.</p>
<p dir="auto">Thanks,<br />
Alana</p>
]]></description><link>https://forums.inedo.com/post/19650</link><guid isPermaLink="true">https://forums.inedo.com/post/19650</guid><dc:creator><![CDATA[atripp]]></dc:creator><pubDate>Fri, 08 May 2026 01:48:37 GMT</pubDate></item></channel></rss>