How to set $ into a variable?

nginx.conf:
location / {

set $var “$uri=200k”

and run “curl localhost/”

The module use ngx_http_get_indexed_variable() for $var will get the
string “/=200k”, but I want the value is “$uri=200k”.

So any escape character supported in nginx.conf?

THANKS.

Posted at Nginx Forum:

may be try set $var “$uri=200k”

2011/11/18 bigplum [email protected]:


MagicBear

Hello!

On Thu, Nov 17, 2011 at 10:06:40PM -0500, bigplum wrote:

So any escape character supported in nginx.conf?

Right now there are no way to escape $ in arguments which support
variables. This is a bug.

Possible workaround is to use some variable defined with module
which doesn’t support variables, e.g. you may do so with geo:

geo $dollar {
    default  "$";
}

...
set $var "${dollar}uri=200k"
...

Maxim D.