nginx Vhost Location Directive: Written with Extra Curly Brace
Modifying domain entries & performing an nginx restart, triggers nginx to rewrite the domain-specific vhost file. After upgrading nginx to v3.0.5.1, rewritten vhost files have an extra opening curly brace in specific location directives.
For instance, the location directive in one domain's vhost file was rewritten to this:
location / { { try_files $uri $uri/ /index.php?$args /index.php?q=$uri&$args =404;
include /etc/nginx/fcgi.conf;
fastcgi_pass unix:/var/lib/php5-fpm/web12.sock;
fastcgi_index index.php;
}
Note the added opening curly brace. upon performing an nginx restart, an exception is thrown & the server fails to start. the added curly braces must be removed to successfully restart the nginx service. The directive had formerly been written correctly as:
location / { try_files $uri $uri/ /index.php?$args /index.php?q=$uri&$args =404;
include /etc/nginx/fcgi.conf;
fastcgi_pass unix:/var/lib/php5-fpm/web12.sock;
fastcgi_index index.php;
}
Curiously, the added curly brace isn't added to every location directive. It seems only location directives that have an opening forward slash ("/"), have fallen victim to this glitch. Three other location directives did not exhibit the same consequence: location ~ .php$ {... location @wordpress {... location ~* ^.+.(jpg|jpeg|...
One additional location directive, beginning with a forward slash ("/") also exhibited this rewrite behavior. The nature of the behavior leads me to believe that leading forward slashes are not being escaped correctly in the underlying parser.
As a temporary fix, I have removed the opening curly brace in the two location directives that open with a ("/") in my nginx_vhost.conf.master file. This affords provision for erroneously added curly brace that inserts itself, otherwise needlessly. (note: I have also noted this workaround in my own nginx_vhost.conf.master, so I am able to recall why my upgraded ispconfig is now incurring new exceptions, after this bug has been fixed!!! )
current nginx version: v3.0.5.1 previous nginx version: v3.0.4.6 os: centos v6.3