# Passing variables via passenger\_set\_cgi\_param

**URL:** <https://www.ruby-forum.com/t/passing-variables-via-passenger-set-cgi-param/212507>\
**Category:** NGINX\
**Created:** [October 5, 2011, 3:28am UTC](https://www.ruby-forum.com/t/passing-variables-via-passenger-set-cgi-param/212507 "2011-10-05T03:28:06Z")\
**Posts on this page:** 2\
**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:** [October 5, 2011, 3:28am UTC](https://www.ruby-forum.com/t/passing-variables-via-passenger-set-cgi-param/212507/1 "2011-10-05T03:28:06Z")

</div>

Hi,  
My nginx location configuration looks like this

```
location ~* ^/z/(\d+)$ {
            set $mID $1;
            set $tag_type 'z';

            access_log /opt/nginx/logs/bright_tag.log

```

bright\_tag\_log;  
if ($arg\_uid ~\* ‘.+’) {  
access\_log /opt/nginx/logs/product\_uid.log  
prod\_log;  
}

```
            if ($arg_orderNumber ~* '.+') {
                    access_log /opt/nginx/logs/conversion.log

```

conv\_log;  
}

```
            if ($arg_prodID ~* '.+') {
                    access_log /opt/nginx/logs/product_uid.log

```

prod\_log;  
}

```
            root html/bright_tag/public;
            passenger_enabled on;
            passenger_set_cgi_param UID $uid_set$uid_got;
    }

```

When I hit the uri /z/123, I am able to access UID parameter in my  
sinatra application. But when I hit this uri /z/123?prodID=25, Nginx  
does not pass UID parameter to my application. I googled around for a  
while about this issue but everything was in vain. Can anyone give some  
suggestions regarding this?

Thanks,  
Dhaval.

---

<div class="post-metadata">

**Author:** ![dhaval\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@dhaval\_d](https://www.ruby-forum.com/u/dhaval_d)\
**Post date:** [October 5, 2011, 5:50pm UTC](https://www.ruby-forum.com/t/passing-variables-via-passenger-set-cgi-param/212507/2 "2011-10-05T17:50:50Z")

</div>

ok never mind. I figured out myself.

dhaval deshpande wrote in post #1025082:

> Hi,  
> My nginx location configuration looks like this
> 
> ```
> location ~* ^/z/(\d+)$ {
> set $mID $1;
> set $tag_type 'z';
> 
> access_log /opt/nginx/logs/bright_tag.log
> 
> ```
> 
> bright\_tag\_log;  
> if ($arg\_uid ~\* ‘.+’) {  
> access\_log /opt/nginx/logs/product\_uid.log  
> prod\_log;  
> }
> 
> ```
> if ($arg_orderNumber ~* '.+') {
> access_log /opt/nginx/logs/conversion.log
> 
> ```
> 
> conv\_log;  
> }
> 
> ```
> if ($arg_prodID ~* '.+') {
> access_log /opt/nginx/logs/product_uid.log
> 
> ```
> 
> prod\_log;  
> }
> 
> ```
> root html/bright_tag/public;
> passenger_enabled on;
> passenger_set_cgi_param UID $uid_set$uid_got;
> }
> 
> ```
> 
> When I hit the uri /z/123, I am able to access UID parameter in my  
> sinatra application. But when I hit this uri /z/123?prodID=25, Nginx  
> does not pass UID parameter to my application. I googled around for a  
> while about this issue but everything was in vain. Can anyone give some  
> suggestions regarding this?
> 
> Thanks,  
> Dhaval.
