Keep Alive piles up
Maxim Dounin
mdounin at mdounin.ru
Tue Jun 30 00:18:57 MSD 2009
Hello!
On Mon, Jun 29, 2009 at 03:27:32PM -0400, meto wrote:
> > Yes, separate normal locations or nested ones is
> > the way to go.
> >
> > Maxim Dounin
>
> I read documentation for further details and that's what i found:
>
> if: "Checks the truth of a condition. If the condition evaluates to true, then the code indicated in the curly braces is carried out and the request is processed in accordance with the configuration within the following block."
>
> location: "While nested locations are allowed by the configuration file parser, their use is discouraged and may produce unexpected results."
>
> http://wiki.nginx.org/NginxHttpRewriteModule#if In examples we can clearly see that it is used with proxy_pass, which is similar fastcgi_pass.
Looks like you assume that wiki == documentation. It's simply not
true.
Yes, nested locations have drawbacks due to some inheritance bugs
(and hence they still aren't documented in official docs). But
if's are in fact nested locations under the hood - and they have
the same bugs, plus problems itroduced by the mentioned imperative
nature.
I'm not saying you can't use if's. Just warn. It's up to you to
decide.
> I'll add the break, but as I said try passing JPG files to fastcgi - this seams to be a problem in my case.
This is problem in your config, but not in nginx itself. Feel the
difference. :)
I believe checking for "\.php(/.*)?$" instead of "\.php(.*)$"
should fix your problem with jpg files (at least if you control
your directory names).
>Because in some cases fastcgi_pass was the last if() in location and still it led to the crash.
Could you please provide an example config with fastcgi_pass in
last matched if() that results in nginx crash? Note that only
*matched* if() matters.
Maxim Dounin
More information about the nginx
mailing list