# Get a variable value in my module

**URL:** <https://www.ruby-forum.com/t/get-a-variable-value-in-my-module/202039>\
**Category:** NGINX\
**Created:** [January 20, 2011, 10:45am UTC](https://www.ruby-forum.com/t/get-a-variable-value-in-my-module/202039 "2011-01-20T10:45:11Z")\
**Posts on this page:** 1\
**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 20, 2011, 10:45am UTC](https://www.ruby-forum.com/t/get-a-variable-value-in-my-module/202039/1 "2011-01-20T10:45:11Z")

</div>

Hello,

I have problem with getting the value of a variable from nginx conf file  
in my module - $arg\_u.  
Code in my module seems like:

{ ngx\_string(“ap\_filter\_sessionid”),  
NGX\_HTTP\_MAIN\_CONF|NGX\_HTTP\_SRV\_CONF|NGX\_HTTP\_LOC\_CONF|NGX\_CONF\_TAKE1,  
ngx\_conf\_set\_str\_slot,  
NGX\_HTTP\_LOC\_CONF\_OFFSET,  
offsetof(ngx\_http\_ap\_filter\_loc\_conf\_t, sessionid),  
NULL },

There is string “$arg\_u” in the variable sessionid in  
ngx\_http\_ap\_filter\_loc\_conf\_t struct and not the read value of the  
variable. I went through some module codes and I found out that I should  
write my function instead of ngx\_conf\_set\_str\_slot directive. I tried to  
write it, but it has never worked. What should be in this function.

Thanks a lot in advance.

Michal

Posted at Nginx Forum:

> **[get a variable value in my module](https://forum.nginx.org/read.php?2,167851,167851#msg-167851)**
>
> Hello, I have problem with getting the value of a variable from nginx conf file in my module - $arg\_u. Code in my module seems like: { ngx\_string("ap\_filter\_sessionid"), NGX\_HTTP\_MAIN\_CONF|NGX\_HTTP\_SRV\_CONF|NGX\_HTTP\_LOC\_CONF|NGX\_CONF\_TAKE1,...
