Weird issues with nginx

Vasil Kolev vasil at ludost.net
Sun Jun 16 19:56:22 UTC 2013


В 01:01 +0300 на 16.06.2013 (нд), Vasil Kolev написа:
> В 22:06 +0100 на 15.06.2013 (сб), Francis Daly написа:
> 
> > The usual first step would be to see whether the problem persists when
> > you just use the distributed nginx, with no external modules or patches.
> > 
> > But in this case, that's probably unnecessary, since you already know
> > that without the "if" statements, no problems appear.
> > 
> > 
> > You use "if" inside "location", and you do something other than "return
> > ..." or "rewrite ... last". Under those circumstances, pretty much all
> > bets are off (unless you can explain why your use is safe).
> > 
> > See http://wiki.nginx.org/IfIsEvil for some more details.
> > 
> > Perhaps using a "map" to set values to be used in limit_rate and
> > limit_rate_after directives would avoid the "if in location" problem?
> > 
> 
> 
> The limit_rate directive doesn't accept a variable as a parameter,
> otherwise that would've been easier. I might just copy the location 4
> times with the speed hardcoded for each one, to get rid of the ifs,
> shouldn't be too ugly.
> 
> I'll test this tomorrow.
> 


It definitely works this way. Is there anything that can be done to
detect whenever the "if" is used in a dangerous way? Seems like a bad
idea to be able to crash the webserver with a simple config.


-- 
Regards,
Vasil Kolev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130616/87d6d05e/attachment.bin>


More information about the nginx mailing list