Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx Redis invalid condition Beta

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by jcat, Sep 14, 2016.

  1. jcat

    jcat Member

    153
    22
    18
    Jun 21, 2015
    New Jersey
    Ratings:
    +64
    Local Time:
    1:17 AM
    Hello,


    Just did a fresh install with WordPress, setting up for redis and getting:

    [root@ngx /]# nginx -t
    nginx: [emerg] invalid condition "!-f" in /usr/local/nginx/conf/php-rediscache.conf:4
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,927
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    3:17 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    weird it is same setting on line 4 in /usr/local/nginx/conf/php.conf and that works
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,927
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    3:17 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh i see forgot to escape them on setup

    without escaping the cat generated php-rediscache.conf file, you loose the $ character

    in php-rediscache.conf all the instances of $ should exist
    Code (Text):
    location ~ [^/]\.php(/|$) {
      include /usr/local/nginx/conf/503include-only.conf;
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

    the bug is that without escaping them during php-rediscache.conf creation, all the $ instances would of been removed

    So to manually fix replace 1st 6 lines of file php-rediscache.conf with above version

    Already updated Centmin Mod 123.09beta01 :)
     
    Last edited: Sep 14, 2016
  4. jcat

    jcat Member

    153
    22
    18
    Jun 21, 2015
    New Jersey
    Ratings:
    +64
    Local Time:
    1:17 AM
    Your awesome man, thank you
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,927
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    3:17 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    and thanks for bug report.. one step closer to 123.09beta01 becoming stable :)