Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
September 28, 2011 04:26AM
Hello!

On Tue, Sep 27, 2011 at 09:30:40PM -0400, Peter Portante wrote:

> On Wed, Aug 31, 2011 at 11:52 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
>
> > Hello!
> >
> > On Wed, Aug 31, 2011 at 11:26:29AM -0400, Peter Portante wrote:
> >
> > > Hello folks,
> > >
> > > Just thought I would report a small bug with rewrite interacting with if.
> > >
> > > Here is my simple setup:
> > >
> > > server {
> > > server_name example.dev.com;
> > > location ^~ /salad/add {
> > > if ($arg_paramThree = "foobar") {
> > > rewrite ^
> > > https://example.this.com?PARAM_ONE=$arg_paramOne&PARAM_TWO=$arg_paramTwo
> > ?
> > > redirect;
> > > }
> > > proxy_pass http://127.0.0.1:8080$request_uri;
> > > }
> > > }
> > >
> > > So when I hit the server with this URL:
> > >
> > >
> > http://example.dev.com/salad/add?paramThree=foobar&paramTwo=two&paramOne=one
> > >
> > >
> > > It is rewritten to be:
> > >
> > > https://example.this.com?PARAM_ONE=one&PARAM_TWO=two?paramThree=foobar
> > >
> > >
> > > If I use the following if conditional, the behavior is as expected:
> > >
> > > if ($args ~ "paramThree=foobar") {
> >
> > Works ok here. Which nginx version do you use?
> >
>
> 1.0.4
>
> thanks for taking the time to check it out.

Could you please provide debug log? Please see
http://wiki.nginx.org/Debugging for details.

Maxim Dounin

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

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

Peter Portante August 31, 2011 11:28AM

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

Maxim Dounin August 31, 2011 11:54AM

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

Peter Portante September 27, 2011 09:32PM

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

Maxim Dounin September 28, 2011 04:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
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