Join the community today
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

    53
    13
    8
    Jun 21, 2015
    Ratings:
    +20
    Local Time:
    4:49 PM
    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
     
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,902
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    7:49 AM
    Nginx 1.13.x
    MariaDB 5.5
    weird it is same setting on line 4 in /usr/local/nginx/conf/php.conf and that works
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,902
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    7:49 AM
    Nginx 1.13.x
    MariaDB 5.5
    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
    • Like Like x 1
  4. jcat

    jcat Member

    53
    13
    8
    Jun 21, 2015
    Ratings:
    +20
    Local Time:
    4:49 PM
    Your awesome man, thank you
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    30,902
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    7:49 AM
    Nginx 1.13.x
    MariaDB 5.5
    and thanks for bug report.. one step closer to 123.09beta01 becoming stable :)