nginx-1.1.12

Maxim Dounin mdounin at mdounin.ru
Wed Dec 28 00:16:14 UTC 2011


Hello!

On Tue, Dec 27, 2011 at 09:29:38PM +0200, Boyko Yordanov wrote:

> The quick fix did the trick.
> 
> Maybe best if changelog entries contain info whether new 
> features/bugfixes require updating current nginx configuration 
> to preserve nginx behavior with newer version or similar?
> 
> Having in mind I'm using relatively common nginx 
> configuration/apache backend, once these changes are applied to 
> the stable release they will probably affect many others?

This change won't be applied to stable.  It was initially intended 
to go to current only, see patch discussion here:

http://mailman.nginx.org/pipermail/nginx-devel/2011-December/001620.html

Actually, I even consider backing it out in current, as 
configuration in question is quite common and I don't really like 
both of the workarounds.  I don't like previous behaviour either, 
but the change seems to be more drastic than it was originally 
expected.

Maxim Dounin

> 
> Many thanks!
> 
> Boyko
> 
> On Dec 27, 2011, at 7:11 PM, Maxim Dounin wrote:
> 
> > Hello!
> > 
> > On Tue, Dec 27, 2011 at 06:09:50PM +0200, Boyko Yordanov wrote:
> > 
> >> nginx 1.1.12 behaves differently compared to nginx 1.1.11 on my 
> >> setup which I'll try to explain below.
> > 
> > [...]
> > 
> >> While my configs may not be optimized or may even be wrong, they 
> >> were interpreted differently by every nginx version other than 
> >> 1.1.12. Not sure if this is something I have to fix by changing 
> >> my configs?
> > 
> > (cc'd back to list)
> > 
> > Ok, so basically your config (simplified) is as follows:
> > 
> >    location / {
> >        index index.php;
> >    }
> > 
> >    location ~ \.php$ {
> >        proxy_pass http://backend;
> >    }
> > 
> > With 1.1.12 proxy_pass without URI component always uses modified 
> > URI after internal redirects, and as a result "/index.php" request 
> > is passed to upstream instead of "/" previously (as index module 
> > does an internal redirection, see [1]).
> > 
> > Apparently your backend doesn't like this and returns 302 in an 
> > attempt to normalize the URI.
> > 
> > Quick fix is to use something like
> > 
> >    location ~ \.php$ {
> >        proxy_pass http://backend$request_uri;
> >    }
> > 
> > to ensure original request uri is passed to upstream.  
> > Alternatively, you may use something like
> > 
> >    location ~ (\.php|/)$ {
> >        proxy_pass http://backend;
> >    }
> > 
> > [1] http://www.nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration
> > 
> > Maxim Dounin
> > 
> 



More information about the nginx mailing list