Join the community today
Register Now

Wordpress variable not set for WP Super Cache (centmin menu option #22)

Discussion in 'Blogs & CMS usage' started by JarylW, Sep 18, 2015.

  1. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    9:25 AM
    installing wordpress using option 22 in menu. Default installation and nginx wont run.

    [root@sone conf.d]# nginx -t
    nginx: [emerg] unknown "cache_uri" variable

    in generated vhost.domain.com.conf, the variable was not defined.

    Find
    Code:
      location / {
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    Replace
    Code:
      
    set $cache_uri $request_uri;
    
        # POST requests and urls with a query string should always go to PHP
        if ($request_method = POST) {
            set $cache_uri 'null cache';
        }  
        if ($query_string != "") {
            set $cache_uri 'null cache';
        }  
    
        # Don't cache uris containing the following segments
        if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
            set $cache_uri 'null cache';
        }  
    
        # Don't use the cache for logged in users or recent commenters
        if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
            set $cache_uri 'null cache';
        }
    
    location / {
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,903
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    11:25 AM
    Nginx 1.13.x
    MariaDB 5.5
    you're meant to have an include file /usr/local/nginx/conf/wpsupercache_newdomain.com.conf with those variables so might be related to same problem @RoldanLT reported at WP Setup menu 22 has issues | Centmin Mod Community

    i'll doublecheck again the function

    are saying yes or no to self-signed ssl certificate on centmin.sh menu option 22 run ?
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,903
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    11:25 AM
    Nginx 1.13.x
    MariaDB 5.5
  4. eva2000

    eva2000 Administrator Staff Member

    30,903
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,404
    Local Time:
    11:25 AM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Sep 18, 2015
    • Like Like x 2
  5. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    9:25 AM
    Wow that was fast. Thanks for the quick fix. It was not a deal breaker anyway ;)