Small bug in rewrite rules using if (ugh, yes, if is bad ...)

Peter Portante peter.a.portante at
Wed Aug 31 15:26:29 UTC 2011

Hello folks,

Just thought I would report a small bug with rewrite interacting with if.

Here is my simple setup:

server  {
    location    ^~  /salad/add {
        if ($arg_paramThree = "foobar") {
            rewrite     ^$arg_paramOne&PARAM_TWO=$arg_paramTwo?

So when I hit the server with this URL:

It is rewritten to be:

If I use the following if conditional, the behavior is as expected:

if ($args ~ "paramThree=foobar") {

I tried to use OpenID for Nginx Trac, but am a little leary to do so because
the server cert is not valid. So I am posting it here.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list