NGINX Configuration for WP Rocket

WP Rocket will work out of the box on NGINX servers, this configuration is not required. It just provides the rules that would otherwise be present in the htaccess file on Apache servers.

Maxime Jobin has provided us with a configuration for NGINX. From the README file:

It enables NGINX to directly serve previously cached files without calling WordPress or any PHP. It also adds headers to cached CSS, JS and images via browser cache.

Check it out on GitHub: https://github.com/maximejobin/rocket-nginx

Thanks Maxime! 🎩

Tip: Read this article in case you have activated WP Rocket’s Mobile Cache option on NGINX.

Additional Tip: If you're using a custom cache folder, you will need to adjust references to the original cache folder path in the configuration.