Join the community today
Register Now

Wordpress Using WP Rocket plugin

Discussion in 'Blogs & CMS usage' started by Matt Williams, Sep 29, 2015.

  1. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    Hello,
    Recently, I was approached by WP Rocket to try their Plugin. After installing it and use their css and js minifier feature, I get a 403 forbidden error message when accessing a .css file like below:

    and I get that when accessing: https://mysite.com/wp-content/cache/min/1/5bcf2bdbad2d60c44a5f6c9b4508ca0c.css

    the .css file is already minified by the plugin but nginx will not allow access to it...

    Anyone can tell how I can fix it?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    anything in nginx vhost error and access logs for those 403 files ?
     
  3. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    Server logs show:

     
  4. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    what does your nginx vhost look like ?
     
  5. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    Code:
    server {
      server_name xxxxxx.com http://www.xxxxxxx.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/xxxxxx.com/log/access.log combined bu$
      error_log /home/nginx/domains/xxxxxx.com/log/error.log;
    
      root /home/nginx/domains/xxxxxxx.com/public;
    
      # prevent access to ./directories and files
      location ~ (?:^|/)\. {
       deny all;
      }
    
    include /usr/local/nginx/conf/wpsupercache_xxxxxx.com.conf;
    
      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 $ur$
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/xxxxxx.com/htpasswd_wplog$
        include /usr/local/nginx/conf/php-wpsc.conf;
    # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/xxxxx.com/htpasswd_wplog$
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwplogin burst=2 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    }
    
      include /usr/local/nginx/conf/wpsecure_xxxxxx.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
      include /usr/local/nginx/rocket-nginx/rocket-nginx.conf;
    }
    
     
    Last edited by a moderator: Sep 29, 2015
  6. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    Edited your post to also wrap in CODE tags easier to read

    For troubleshooting

    try commenting out /usr/local/nginx/conf/wpsecure_xxxxxx.com.conf include

    and/or
    Code:
      # prevent access to ./directories and files
      location ~ (?:^|/)\. {
       deny all;
      }
    and/or /usr/local/nginx/conf/drop.conf include file

    if any have rules that may trigger the problem
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    oh btw, what's contents of /usr/local/nginx/rocket-nginx/rocket-nginx.conf ? use CODE tags

    could of overlapped with other rules ?
     
  8. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    I tried the above and commented them out but still gives me the 403 forbidden..
    The contents of the /usr/local/nginx/rocket-nginx/rocket-nginx.conf is located HERE

    Its used when your only using nGinx as the server...
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    oh so wp rocket does full page caching too, so could conflict with wp-super cache settings so need to revert wp super cache nginx settings

    switch back to default centmin mod php include

    from several instances exist in nginx vhost
    Code:
    include /usr/local/nginx/conf/php-wpsc.conf;
    to
    Code:
    include /usr/local/nginx/conf/php.conf;
    disable permalinks for wp super cache so comment it out and uncomment normal one
    Code:
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $ur$
    
      # Wordpress Permalinks
      try_files $uri $uri/ /index.php?q=$uri&$args;
    comment out
    Code:
    include /usr/local/nginx/conf/wpsecure_xxxxxx.com.conf;
    and see

    it's similar process to changing from wp super cache to nginx level redis cache - btw, if you get the chance some siege benchmarks for wp super cache vs wp rocket vs nginx level redis cache would be interesting :)

    and disable wp super cache plugin
     
    Last edited: Sep 29, 2015
  10. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    Still gives me the 403 Forbidden :=( I did all the above steps. WP Super Cache is disabled - I also have redis cache installed using the Redis Cache Plugin. Still gives me the 403 though when viewing the actual Cached css or JS file when viewing the source of the page.
     
  11. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    strange then

    noticed the site in 1st post is over SSL https, did you make sure to edit the https Nginx vhost and not just non-https http Nginx vhost appropriately ?
     
  12. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
    Glad you mentioned the ssl.conf file because I totally overlooked that lol! Which fixed the issue and I must say that WP Rocket is indeed faster then WP Super Cache.

    With WP Super Cache, my page was loading around 1.40 sec. now with WP Rocket it loads 1.09 sec.

    I'm going to test with siege and I'll post the outcome here.
     
    • Like Like x 1
  13. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    haha.. glad that helped !

    Interesting to see if you can throw Redis Nginx level caching into the benchmark mix too

    of course WP Super Cache doesn't minify css etc so you need to combine with Autoptimize WP Plugin or something

    FYI, for reference

    Nginx level Redis Cache is ~45% faster than WP Super Cache with apples to apples comparison of same amount of posts on WP Index page.
    • WP Super Cache + Redis Object Caching 1,610.82 trans/sec & longest trans time = 0.16s
    • Nginx level Redis Cache + Redis Object Caching 2,337.54 trans/s & longest trans time = 0.09s
    WP Super Cache + Redis Object Caching
    Code:
    siege -b -c50 -r1000 http://newdomain.com/
    
    Transactions:                  50000 hits
    Availability:                 100.00 %
    Elapsed time:                  31.04 secs
    Data transferred:             346.57 MB
    Response time:                  0.03 secs
    Transaction rate:            1610.82 trans/sec
    Throughput:                    11.17 MB/sec
    Concurrency:                   49.42
    Successful transactions:       50000
    Failed transactions:               0
    Longest transaction:            0.16
    Shortest transaction:           0.00
    Nginx level Redis Cache + Redis Object Caching
    Code:
    siege -b -c50 -r1000 http://newdomain.com/
    
    Transactions:                  50000 hits
    Availability:                 100.00 %
    Elapsed time:                  21.39 secs
    Data transferred:             346.57 MB
    Response time:                  0.02 secs
    Transaction rate:            2337.54 trans/sec
    Throughput:                    16.20 MB/sec
    Concurrency:                   49.44
    Successful transactions:       50000
    Failed transactions:               0
    Longest transaction:            0.09
    Shortest transaction:           0.00
     
    Last edited: Sep 29, 2015
    • Informative Informative x 1
  14. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    4:25 PM
    1.11
    10.2
    From the looks of it's config and Plugin Feature set, WP Rocket is just the same as WP-Super-Cache implementation pair with ngx_pagespeed features.

    I would stick to WP-Super-Cache, very solid for for every site I manage plus it's FREE.
    And you have the control for everything.

    And their nginx config is so bad! :D
    with 10+ if conditions, wooh! That would stress Nginx CPU usage.

    Mine only use 1/single IF, and I only bypass cache via cookies.

    Plus adding a lot of useless HTTP Headers (n)
    Looks like your debugging every page request.
     
    • Informative Informative x 1
  15. Matt Williams

    Matt Williams WordPress Fanatic

    468
    90
    28
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +135
    Local Time:
    3:25 AM
    latest
    10
  16. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
  17. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    4:25 PM
    @eva2000

    Do you run siege from the same vps, from another in the same location, or from your work desktop/laptop?
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    proper way is to run from remote server and not same as vps..

    but quick runs for low load siege tests from same vps are okay
     
  19. JarylW

    JarylW Active Member

    216
    40
    28
    Jun 19, 2014
    Singapore
    Ratings:
    +102
    Local Time:
    4:25 PM
    My test parameters are :
    Siege performed on home desktop
    Frontpage is a modified Wordpress theme with full screen Revslider and 4 WooCommerce products.

    Also note that RocketWP had lesser resources (files downloaded on each Page Load) than Redis-nginx because I had to exclude some css and js in autoptimize for the theme to function properly whereas RocketWP did everything automatically without breaking (at least for this theme).

    Note that I did not use redis object cache or any object cache plugin.

    Code:
    Redis-Nginx
    
    Lifting the server siege...      done.
    Transactions:                  48076 hits
    Availability:                  99.87 %
    Elapsed time:                 560.14 secs
    Data transferred:             523.96 MB
    Response time:                  0.21 secs
    Transaction rate:              85.83 trans/sec
    Throughput:                     0.94 MB/sec
    Concurrency:                   17.86
    /Successful transactions:       48076
    Failed transactions:              62
    Longest transaction:            9.38
    Shortest transaction:           0.02
    
    Code:
    WP-Rocket
    
    Lifting the server siege...      done.
    Transactions:                  47437 hits
    Availability:                  99.74 %
    Elapsed time:                 440.25 secs
    Data transferred:             565.36 MB
    Response time:                  0.17 secs
    Transaction rate:             107.75 trans/sec
    Throughput:                     1.28 MB/sec
    Concurrency:                   18.35
    /Successful transactions:       47437
    Failed transactions:             126
    Longest transaction:            9.21
    Shortest transaction:           0.02
    
    Had to stop the siege because it wouldn't print the summary. Maybe glitchy on windows - not sure.

    I don't know what to make of this siege results. But pagespeed tests show that rocket-wp is indeed faster.
     

    Attached Files:

    Last edited: Oct 1, 2015
    • Informative Informative x 1
  20. eva2000

    eva2000 Administrator Staff Member

    30,951
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    6:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    well there's several things here

    Total completed and failed transactions vs trans/sec. If you look at the former, Nginx Redis WP slightly better. But css/js handling seems WP Rocket has that covered better.

    But you should also add Redis Object cache to mix and see too

    We should hunt around for other css/js optimising WP plugins to try and pair with WP Super Cache or Nginx Redis level caching.