Want more timely Centmin Mod News Updates?
Become a Member

WP Rocket installation on Nginx

Discussion in 'Blogs & CMS usage' started by Mrbo, Feb 25, 2019.

  1. BamaStangGuy

    BamaStangGuy Active Member

    663
    189
    43
    May 25, 2014
    Ratings:
    +268
    Local Time:
    4:38 PM
    Unfortunately, I wasn't able to get this to work either. It kept saying mobile caching was active, even though it was disabled. I edited the default.conf to remove checks, then it would say it was cached but I could load a heavy page that uses MySQL and each request would hit php-fpm and MySQL despite it saying it was being served via Nginx.

     
  2. zkylizer

    zkylizer New Member

    16
    0
    1
    Jun 5, 2019
    Ratings:
    +2
    Local Time:
    4:38 AM
    1.17.0
    MariaDB 10
    Same here, i try using at location / {
    Code (Text):
    try_files $uri $uri/ /index.php?$args;
    

    Or
    Code (Text):
    try_files "/wp-content/cache/wp-rocket/$host${uri}$is_args$args/index-https.html_gzip" $uri $uri/ /index.php$is_args$args;
    

    Result still :
    X-Rocket-Nginx-Serving-Static: No
     
  3. EckyBrazzz

    EckyBrazzz Active Member

    906
    189
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +358
    Local Time:
    6:38 PM
    Latest
    Latest
    In my WP-Multidomain setup this is still working fine.

    In the beginning I noticed that if you selected a single time in wp-rocket cache mobile it stopped working correctly. After changing the settings still no go.

    Deleting or creating the directory with the cache file as indicated in the debug mode resolved the issue.

    So delete and/or (re)create the directory with the cache file.
    Code (Text):
    X-Rocket-Nginx-File: /home/nginx/domains/domain.com/public/wp-content/cache/wp-rocket/domain.com///index-https.html_gzip
    
     
  4. zkylizer

    zkylizer New Member

    16
    0
    1
    Jun 5, 2019
    Ratings:
    +2
    Local Time:
    4:38 AM
    1.17.0
    MariaDB 10
    fixed by disable mobile cache in wprocket setting
     
    Last edited: Apr 18, 2020
  5. radbrad

    radbrad Member

    34
    3
    8
    Feb 15, 2020
    Ratings:
    +4
    Local Time:
    3:08 AM
    Hi got these errors even after trying the steps @Mrbo said:
    nginx: [emerg] "set" directive is not allowed here in /etc/nginx/rocket-nginx/rocket-nginx.conf:17
    nginx: configuration file /etc/nginx/nginx.conf test failed
     
  6. EckyBrazzz

    EckyBrazzz Active Member

    906
    189
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +358
    Local Time:
    6:38 PM
    Latest
    Latest
    @radbrad . You are using the wrong directory. Should use include /usr/local/nginx/conf/wpincludes/mydomain.org/rocket-nginx/default.conf; and place the include just before the location/

    Code (Text):
      include /usr/local/nginx/conf/wpincludes/mydomain.org/wpcacheenabler_mydomain.org.conf;
      #include /usr/local/nginx/conf/wpincludes/mydomain.org/wpsupercache_mydomain.org.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/mydomain.org/rediscache_mydomain.org.conf;
    
      #WP ROCKET
    
      include /usr/local/nginx/conf/wpincludes/mydomain.org/rocket-nginx/default.conf;
      
      location / {
    
     
  7. tininho

    tininho Active Member

    177
    39
    28
    May 22, 2019
    Ratings:
    +128
    Local Time:
    12:38 AM
    If you choose Wordpress Super Cache on Wordpress caching while running option 22, do the following to change to WP Rocket:

    Replace/add/comment out on your /usr/local/nginx/conf/conf.d/domain.com.ssl.conf:

    comment out
    Code:
    include /usr/local/nginx/conf/wpincludes/domain.com/wpsupercache_domain.com.conf;
    add
    Code:
    include /usr/local/nginx/rocket-nginx/conf.d/default.conf;
    replace try_files
    Code:
    try_files $uri $uri/ /index.php?$args;
    Run on terminal
    Code:
    sed -i 's/php-wpsc/php/g' /usr/local/nginx/conf/conf.d/domain.com.ssl.conf
    cd /usr/local/nginx
    git clone https://github.com/SatelliteWP/rocket-nginx.git
    cd rocket-nginx; cp rocket-nginx.ini.disabled rocket-nginx.ini
    php rocket-nginx.ini; php rocket-parser.php
    ngxrestart
    
    Done. This is compiled from other users on this thread
     
  8. eva2000

    eva2000 Administrator Staff Member

    49,034
    11,234
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,485
    Local Time:
    7:38 AM
    Nginx 1.21.x
    MariaDB 10.x
    Nice thanks for sharing! (y)