# Is it possible to populate $geoip\_country from another value in the header?

**URL:** <https://www.ruby-forum.com/t/is-it-possible-to-populate-geoip-country-from-another-value-in-the-header/201522>\
**Category:** NGINX\
**Created:** [January 10, 2011, 2:47am UTC](https://www.ruby-forum.com/t/is-it-possible-to-populate-geoip-country-from-another-value-in-the-header/201522 "2011-01-10T02:47:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 10, 2011, 2:47am UTC](https://www.ruby-forum.com/t/is-it-possible-to-populate-geoip-country-from-another-value-in-the-header/201522/1 "2011-01-10T02:47:40Z")

</div>

Hi,

we may have a situation where NGINX is behind a load-balancer that  
cloaks  
all source-IPs with its own.  
However, the original source-IP is conserved in a header.  
Would it be possible to populate the geoip\_country variable from that  
other variable?

Best Regards,  
Rainer

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 10, 2011, 4:38am UTC](https://www.ruby-forum.com/t/is-it-possible-to-populate-geoip-country-from-another-value-in-the-header/201522/2 "2011-01-10T04:38:32Z")

</div>

Hello!

On Mon, Jan 10, 2011 at 02:46:42AM +0100, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> we may have a situation where NGINX is behind a load-balancer that cloaks  
> all source-IPs with its own.  
> However, the original source-IP is conserved in a header.  
> Would it be possible to populate the geoip\_country variable from that  
> other variable?

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

real\_ip\_from your.balancer.ip.address;  
real\_ip\_header Header-With-Client-Ip;

Maxim D.
