WP Rocket is a cache plugin for wordpress, many people like this solution and prefer to use it instead of the fastcgi cache.
If you have a license of the plugin and want to use it in conjunction with Nginx to avoid loading in PHP follow this simple tutorial.
1. Install and active the plugin
2. In FTP acess /var/www/YOURDOMAIN.COM and edit your wp-config.php file
- Add this code: define('DISABLE_WP_CRON', true);
- Note: if the plugin is already active you will see that your file has already been edited by it:
3. Acess you ssh and add an new cronjob (to avoid php consults by wordpress)
4. Now lets begin to add nginx configs, in your ssh add this commands, one per one
5. Now, include this in your nginx
- In FTP acess /etc/nginx/sites-available and edit the file with your site domain
- Add this: include rocket-nginx/default.conf;
6. Reload the nginx
Done!
you can check if it is caching directly through nginx (without consulting wordpress) by the site header:
source: https://github.com/maximejobin/rocket-nginx