Comment to 'UNA nginx rewrite rules'
  • rewrite "^/path-to-una/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)" /path-to-una/storage.php?o=$1&f=$2 last;

    This line is causing my NGinx server to hang on startup. A look at the init.d logs shows that the above line is causing a config error like this (not real server name): Mar 30 22:04:50 SUPERSPARC-SC001.contoso.corp nginx[4138]: nginx: [emerg] invalid variable name in /etc/nginx/nginx.conf:

    I am running Novell Netware 6 and NGinx 1.17 (Linux Kernel 4.3.2)

    • Here is my NGinx root server config block in it's entirety:

      location / {
      autoindex on;
      root /srv/www/htdocs/;
      index index.html index.htm index.php;
      }
      location ~ \.php$ {
      root /srv/www/htdocs/;
      try_files $uri $uri/ /index.php?$args;
      # try_files $uri $uri/ /elgg/index.php?$args;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME
      $document_root$fastcgi_script_name;
      fastcgi_param SCRIPT_NAME $fastcgi_script_name;
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      fastcgi_index index.php;
      fastcgi_pass 127.0.0.1:9000;
      rewrite "^/page/(.*)$" /page.php?i=$1 last;
      rewrite "^/m/(.*)$" /modules/index.php?r=$1 last;
      "^/s/([a-zA-Z0-9_]+)/([a-zA-Z0-9\.]+)" /storage.php?o=$1&f=$;
      if (!-e $request_filename ) {
      rewrite ^/(.+)$ /r.php?_q=$1 last;
      break;
      }
      }

      The lines commented out are what i believe to be the offending rewrite rules. Please advise on what i should do. UNA is also giving vague SQL query errors and is not displaying form fields correctly. I have at this point disable UNA entirely, however I would reinstall it if I could be better advised on why these errors are occuring.

      • There are many problems in your code, please move all UNA related rules to "location /" block. Also you need to remove "try_files" rules.

        • Thanks for the advice. i believe i have to have the "try_files" rules because I am using php-fpm instead of FastCGI. However I will try moving the rewrite rules.