Welcome! Log In Create A New Profile

Advanced

Re: How to set $ into a variable?

Maxim Dounin
November 18, 2011 09:18AM
Hello!

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

> 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?

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 Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to set $ into a variable?

bigplum November 17, 2011 10:06PM

Re: How to set $ into a variable?

magicbear November 18, 2011 09:00AM

Re: How to set $ into a variable?

Maxim Dounin November 18, 2011 09:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 186
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready