# Getting CSV file values as nginx variable

**URL:** <https://www.ruby-forum.com/t/getting-csv-file-values-as-nginx-variable/207797>\
**Category:** NGINX\
**Created:** [June 2, 2011, 11:30pm UTC](https://www.ruby-forum.com/t/getting-csv-file-values-as-nginx-variable/207797 "2011-06-02T23:30:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 2, 2011, 11:30pm UTC](https://www.ruby-forum.com/t/getting-csv-file-values-as-nginx-variable/207797/1 "2011-06-02T23:30:29Z")

</div>

Hi,

I need to get values of CSV files in my project:  
John Malkovich,Person,123 Mulholland Drive,…  
to have in config something like:  
csv\_path /path/to/csv/dir;  
csv\_key $arg\_id;

uwsgi\_param USER\_NAME $csv\_1;

what’s the best way for it?

I’ve checked Array Var module by agentzh  
( [GitHub - openresty/array-var-nginx-module: Add support for array-typed variables to nginx config files](https://github.com/agentzh/array-var-nginx-module) )  
looks like it realizes similar task.  
May be I’m looking in wrong direction and answer closer?

---

<div class="post-metadata">

**Author:** ![Roman\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bc8723/32.png) [@Roman\_V](https://www.ruby-forum.com/u/Roman_V)\
**Post date:** [June 4, 2011, 5:25pm UTC](https://www.ruby-forum.com/t/getting-csv-file-values-as-nginx-variable/207797/2 "2011-06-04T17:25:58Z")

</div>

On Fri, Jun 3, 2011 at 5:29 AM, Roman V.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> what’s the best way for it?

Code up some Lua in the rewrite\_by\_lua directive provided by ngx\_lua?

> I’ve checked Array Var module by agentzh  
> ( [GitHub - openresty/array-var-nginx-module: Add support for array-typed variables to nginx config files · GitHub](https://github.com/agentzh/array-var-nginx-module) )  
> looks like it realizes similar task.  
> May be I’m looking in wrong direction and answer closer?

No, you’re looking in a wrong direction, unfortunately 🙂

Regards,  
-agentzh
