# Howto set variable base on header content

**URL:** <https://www.ruby-forum.com/t/howto-set-variable-base-on-header-content/191206>\
**Category:** NGINX\
**Created:** [July 7, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/howto-set-variable-base-on-header-content/191206 "2010-07-07T15:37:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_MAUGE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@Vincent\_MAUGE](https://www.ruby-forum.com/u/Vincent_MAUGE)\
**Post date:** [July 7, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/howto-set-variable-base-on-header-content/191206/1 "2010-07-07T15:37:56Z")

</div>

Hey,

I get nginx as reverse proxy. I want to set a variable base on  
X-Forwarded-For like I can do with geo module. What is the proper way  
to do that ?  
The purpose is to change some behavior base on the original client  
even if he is behind a proxy. I need to be able to set two different  
behavior for two different original IP even if the use the same proxy.  
Currently with geo module, I can only change the behavior if the  
source ip in the tcp connection is different.

Regards,

Vincent
