# Get first field from an nginx variable

**URL:** <https://www.ruby-forum.com/t/get-first-field-from-an-nginx-variable/188142>\
**Category:** NGINX\
**Created:** [May 6, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/get-first-field-from-an-nginx-variable/188142 "2010-05-06T15:04:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danmezzetti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@danmezzetti](https://www.ruby-forum.com/u/danmezzetti)\
**Post date:** [May 6, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/get-first-field-from-an-nginx-variable/188142/1 "2010-05-06T15:04:10Z")

</div>

Hi All,

i’ve a variable on nginx with more fields, from phpinfo i can see its  
values are:

$HTTP\_X\_FORWARDED\_FOR=192.168.1.3, 10.47.0.5, 94.47.0.6, 10.123.65.181

Is it possible to get only the first fields ?

Thanks in advance

Daniele
