Discover Centmin Mod today
Register Now

WP Rocket installation on Nginx

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

  1. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    @fabianski and @eva2000 I took all steps, but I won't purse out WebP images.

    fabianski, thanks for sharing, noticed a little difference it the setup of the SatelliteWP/rocket-nginx setup as you have it on domain level and not on the nginx level. The rest is almost the same, final result is that my config is the same as yours.

    But still pulling out my gray hears, don't know what to do to get it working. I don't use the addon Nginx Serving WebP Images Conditionally Demo, but the plugin WebP Express because it does the same, only has the advantage that it converts on the fly when uploading a new image.

    With that plugin WebP Express and without wp-rockt all was fine.
     
  2. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
  3. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    Getting a little confused, some work others don't. Project_CMM_7273.png
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. fabianski

    fabianski Member

    94
    9
    8
    Feb 20, 2019
    Brazil
    Ratings:
    +28
    Local Time:
    4:43 PM
    I'm not seeing the rocket-nginx header on your site
     
  5. eva2000

    eva2000 Administrator Staff Member

    40,634
    9,023
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,891
    Local Time:
    5:43 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    for Centmin Mod Nginx, you'd want whatever site nginx rules in your domain level nginx vhost config file at domain.com.conf or domain.com.ssl.conf instead of at nginx.conf
     
  6. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    Hmmm, strange. I placed it in the same configuration as you did, but eva2000 tells to not to do that. What should I see when I do a curl -I ?
     
  7. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    @eva2000 If I use Alter HTML it seems to work a (bit) but get a big fat F at webpagetest.org. if I don't use Alter HTML it won't work
     
  8. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    Got the issue with WebP Working, placed this domain behind a Cloudflare PRO Plan + some extra paid services and it worked.
    I even got the headers of NGINX.....chache=YES (can't remember it exactly) and was happy with the result and made a backup and afterwards started the server again. After a while I did the check for the headers again, and, yep no more headers. Installed the SatelliteWP/rocket-nginx again on the domain but what I tried, the headers didn't show up anymore.

    After that I noticed that WebP worked I started to tune Cloudflare and the wp-rocket / autopimizer pluigins. Noticed that I still had troubles with the Lazy Load on the slider of the site, so I have to replace the original that comes with the theme with Slider 3 or something like that.

    Long story short
    Code (Text):
    #WP ROCKET
    
      include /usr/local/nginx/conf/wpincludes/mydomain.org/rocket-nginx/default.conf;
    
      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; 
    
      location / {
    
      include /usr/local/nginx/conf/503include-only.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      #wp rocket
      try_files $uri $uri/ /index.php?$args;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args; 
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    

    :muted:#@!$)$ (404 ERROR) and I did not go away on other pages, only the main page worked. It can be that it has to do with the fact that my theme is heavily modded to fit to my needs (translations of a new kind of page type etc), I already wasted a U$80 on a special domain extension that gave me 404 on everything except the main page after a modification. (It's for sale now, nicely priced, only $3500 first year afterwards $80 again:), domain extension did not fit to my needs anymore, but will keep it for 5-6 years, guess there will be a company / person that will buy it).

    Cloudflare, yes nice option but after testing found that here in Brazil traffic in Sâo Paulo instead of Miami and speed was ok, but could be better. In Australia loading times gone up(over 3 secs), so conclusion as I had before. Need more servers (MariaDB Enterprise galera cluster and some kind of rsync or Corosync and Pacemaker together with Cloudflare Load Balancing.) Think that it will become the first Centmin Cluster experiment:facepalm:.

    For now, I have ngx_pagespeed again because with the above I will save on expensive for extra servers and used the block below because Cloudflare and ngx_pagespeed don't like each other.
    Code (Text):
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    pagespeed unplugged;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    


    But still, for the great performance of wp-rocket I would like that it worked and still can't find what is wrong with the above.

    404 ERROR and the fact that the header of rocket-nginx was sky walking.

    So if anyone here on the forum has a clue or a tip to pinpoint me in a working situation, please post below!(y)
     
  9. fabianski

    fabianski Member

    94
    9
    8
    Feb 20, 2019
    Brazil
    Ratings:
    +28
    Local Time:
    4:43 PM
    You did this?

     
  10. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    @fabianski Well, I once did it but there is only one little difference in these files. Last time(s) I did not change it.

    Diff Checker
     
  11. fabianski

    fabianski Member

    94
    9
    8
    Feb 20, 2019
    Brazil
    Ratings:
    +28
    Local Time:
    4:43 PM
    Why are you modifying this file?

    You have to modify this in the file /usr/local/nginx/conf/conf.d/domain.com.ssl.conf

    like this: Diff Checker
     
  12. EckyBrazzz

    EckyBrazzz Active Member

    463
    95
    28
    Mar 28, 2018
    Brazil
    Ratings:
    +177
    Local Time:
    4:43 PM
    1.17.x
    10.3.x
    I only added GEOIP 2 to it, the only difference in these 2 files is that one gives the result of fastcgi_param SERVER_NAME $http_host; and the other fastcgi_param SERVER_NAME $server_name;
    The function is the same, output is a little different.

    I did change the /usr/local/nginx/conf/conf.d/domain.com.ssl.conf but I did not notice any difference with the result, so stopped changing it. Will give another try on my "lifetime free AWS amazon account". Great for testing. 744hr/m free usage.

    FYI, inside information released it to me. Made a call to Amazon Brazil, and they transfer my call to someone in Ecuador(first I thought, he's terrible with his Portuguese), he transferred me to an employ for support of AWS USA. Get a free Tier AWS account, and just a few days before the year expires, change the email address to [email protected] and get a new account on the same old that you had before. You get a new year with their free tier program on that email again:)