Nginx Config Parser Crashes with Conditionals

virtualmin-nginx::feature_startstop failed : Modification of non-creatable array value attempted, subscript -1 at /usr/share/webmin/virtualmin-nginx/virtualmin-nginx-lib.pl line 107.

^^ that is when i try to reload system info

Nginx Webserver Nginx version 1.0.14 HTTP/1.0 500 Perl execution failed Server: MiniServ/1.580 Date: Fri, 6 Apr 2012 03:25:24 GMT Content-type: text/html; Charset=iso-8859-1 Connection: close Error - Perl execution failed

Modification of non-creatable array value attempted, subscript -1 at virtualmin-nginx-lib.pl line 107.

^^ That is accessing the nginx server module

My configuration has

if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?q=$1 last; } to do a URL rewrite for drupal.

The parser mis-handles it.

There are tons of complex configurations that can occur due to nginx's scripting-like configuration language not including what plugins offer.

Status: 
Closed (fixed)

Comments

Is that all on one line? If so, does it help if you split it across multiple lines, like :

if (!-e $request_filename) {
   rewrite ^/(.*)$ /index.php?q=$1 last;
}

Virtualmin doesn't implement a full Nginx parser, so some configs that are actually more like programs may not be parsed correctly.

Sorry the copy/paste didnt format right. No its exactly how you typed it.

Ok, thanks .. looks like our parser isn't handling that properly, even when it could.

This will be fixed in the next version of the Nginx plugin. Let me know if you'd like a pre-release..

Automatically closed -- issue fixed for 2 weeks with no activity.