Welcome! Log In Create A New Profile

Advanced

Re: How to do location /test/place?id=2

J. Lewis Muir
October 18, 2019 09:48AM
On 10/18, P.V.Anthony wrote:
> On 18/10/19 5:26 am, Jeff Dyke wrote:
> > I know this is not an answer to your question, but it begs another,
> > mainly due to the if statement.  How many of these are you going to
> > have? https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/
> >
> > You've likely considered this, but if not wanted to throw it out there.
> > Even if you are moving domains, could you create a separate route that
> > you could key off rather than arg_id?
>
> Oh no. I was not aware of the "if" danger. Thank you for bringing that up.
>
> I am not able to change the application. Is there another way without using
> "if"?

The "if" behavior is weird, so it's good to avoid it if you can, but
sometimes it really is the only way to do something. And at the top of
that "If Is Evil" page it says:

The only 100% safe things which may be done inside "if" in a location
context are:

* return ...;
* rewrite ... last;

And in your example, you were doing a return inside an "if" which is
noted as being safe in a location context.

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

How to do location /test/place?id=2

P.V.Anthony October 17, 2019 01:02PM

Re: How to do location /test/place?id=2

J. Lewis Muir October 17, 2019 05:16PM

Re: How to do location /test/place?id=2

jeffdyke October 17, 2019 05:28PM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:04AM

Re: How to do location /test/place?id=2

J. Lewis Muir October 18, 2019 09:48AM

Re: How to do location /test/place?id=2

P.V.Anthony October 19, 2019 01:56AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:02AM

Re: How to do location /test/place?id=2

Aleksandar Lazic October 19, 2019 04:24AM

Re: How to do location /test/place?id=2

P.V.Anthony October 20, 2019 01:18AM

Re: How to do location /test/place?id=2

Patrick October 17, 2019 09:04PM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 12:14AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 12:20AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 01:18AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 01:36AM

Re: How to do location /test/place?id=2

P.V.Anthony October 18, 2019 01:58AM

Re: How to do location /test/place?id=2

Patrick October 18, 2019 03:00AM

Re: How to do location /test/place?id=2

P.V.Anthony October 19, 2019 01:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready