behaviour changes upgrading from nginx .6.x to .7.x

Maxim Dounin mdounin at
Mon Jul 13 16:36:39 MSD 2009


On Sat, Jul 11, 2009 at 09:28:01AM -0700, Michael McCallister wrote:

> Greetings,
> First, thanks for nginx - very cool web server.  Next, upon upgrading  
> from 0.6.36 to 0.7.61 I noticed some changes in behaviour which prompted  
> me to downgrade back to 0.6.36 until I could further understand the  
> changes between .6.x and .7.x.  More specifically, here is where things  
> worked differently:
> Given this rewrite rule:  rewrite ^/[Aa]rticles/?(.*) /search.php?q=$1;
> This URL: /Articles/highway+diesel+vehicles
> Would generate the following $_GET in php (5.2.8 using fpm) and nginx  
> (0.6.36):
> array (
>  'q' => 'highway diesel vehicles',
> )
> Whereas the same exact URL would generate the following $_GET in php  
> (5.2.8 using fpm - no changes to php) and nginx (0.7.61 - nginx is the  
> only thing that changed):
> array (
>  'q' => 'highway+diesel+vehicles',
> )
> I view the behaviour under nginx 0.6.36 as correct while the behaviour  
> under 0.7.61 does not result in the expected value.  Obviously it is  
> trivial to workaround this issue, but this leads up to my main concern -  
> what else behaves differently?  I tried to find documentation outlining  
> upgrade considerations while migrating from .6.x to .7.x but could not  
> find any - my apologies if I missed them and/or am asking a question  
> already addressed previously on the list.
> So I guess I really have two questions considering the above:
> 1) Is the above behaviour in .7.x expected?

Yes.  Changes with 0.7.14:


    *) Bugfix: if URI part captured by a "rewrite" directive was used as a 
       query string, then the query string was not escaped.


Note that 'highway+diesel+vehicles' is *unescaped* value ('+' 
has no special meaning when used in path component), and it's 
then escaped when used in query string to 'highway%2bdiesel%2bvehicles' 
(since '+' reserved in query string).  In it's turn php unescapes 
query string escaping and you see

$_GET[q] = 'highway+diesel+vehicles'

exactly as it was captured by your rewrite.

> 2) Is there a list of things to watch out for when changing from .6.x to  
> .7.x?

Changes are documented in CHANGES file in nginx sources
(online version available at  It's not 
exactly what you are asking about, but as far as I know it's all 
we currently have (and it worth reading anyway).

Maxim Dounin

> Any help is greatly appreciated and thanks again for nginx.
> Michael

More information about the nginx mailing list