Getting CSV file values as nginx variable

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 )
looks like it realizes similar task.
May be I’m looking in wrong direction and answer closer?

On Fri, Jun 3, 2011 at 5:29 AM, Roman V.
[email protected] 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 )
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 :slight_smile:

Regards,
-agentzh