Title: [Plugin: W3 Total Cache] NGINX support
Last modified: August 19, 2016

---

# [Plugin: W3 Total Cache] NGINX support

 *  [John Robertson](https://wordpress.org/support/users/braddor/)
 * (@braddor)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/)
 * Hey,
    So I read that official NGINX support wont be available till version 1.0…
   so what can I do to set up the rewrite rules in the mean time to get it running
   on an NGINX only setup?
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Joost Schuur](https://wordpress.org/support/users/jschuur/)
 * (@jschuur)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1606997)
 * I’ve tested it out on a DreamHost PS using ngnix and Xcache, and it works just
   fine, at least based on speed improvements and the footer info on pages.
 * If you’re using disk based caching instead of an opcode solution like Xcache,
   it’s simply a matter or changing one line in the [SuperCache nginx instructions](http://ocaoimh.ie/wordpress-nginx-wp-super-cache/)(
   lines 23-49 in that post). Just change line 40, so it reads:
 * `set $supercache_file /wp-content/w3tc/pgcache/$1/_index.html;
 * Your rewrite rule now matches the directory structure under which the cached 
   files are created with W3 Total Cache.
 *  Thread Starter [John Robertson](https://wordpress.org/support/users/braddor/)
 * (@braddor)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607000)
 * Works for me but Im completely APC, so no need to do any rule rewrites.
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607026)
 * Every implementation of nginx rules I’ve ever seen is complete. Please keep in
   mind that you will get erratic behavior until nginx is officially supported.
 *  Thread Starter [John Robertson](https://wordpress.org/support/users/braddor/)
 * (@braddor)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607032)
 * Im using APC, which I believe doesnt need mod rewrite rules. I cant take advantage
   of browser caching though since I dont want to mess around too much with the 
   Virtual host commands… I rather wait for version 1…
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607041)
 * Sorry I meant to say “incomplete” earlier. Anyway, you’re all set for now then
   if you’re using APC (except for browser cache obviously).
 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607043)
 * [@braddor](https://wordpress.org/support/users/braddor/)
 * You can take advantage of browser caching my adding `expires max;` to your server
   file making sure to only apply it to images, css or js by adding this to your
   server file:
 *     ```
       server {
               listen 80;
   
               server_name  www.xxxxxxx.com xxxxxxxxx.com;
               access_log  /var/log/nginx/xxxxxxx.proxied.log;
   
               # Serve directly:  /images/ + /css/ + /js/
               #
               location ^~ /(images|css|js) {
                       root   /srv/www/xxxxxxxx/public_html/;
                       access_log  /var/log/nginx/xxxxxx.direct.log ;
       expires     max;
               }
               # Serve directly: *.js, *.css, *.rdf,, *.xml, *.ico, & etc
               #
               location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg)$ {
                       root   /srv/www/xxxxxxxx.com/public_html/;
                       access_log  /var/log/nginx/xxxxxxxx.direct.log ;
   
       expires     max;
               }
       ```
   
 * This would be added before your PHP directives.
 * Also take a look at the [Nginx Compatability ](http://wordpress.org/extend/plugins/nginx-compatibility/)
   plugin. I have used it in conjunction with W3-Total cache and there are no conflicts.
   The other option is to use nginx as a front end proxy to serve static files and
   pass everything else to Apache.
 *  Thread Starter [John Robertson](https://wordpress.org/support/users/braddor/)
 * (@braddor)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607044)
 * Thanks c3mdigital. My server is pure NGINX though….i decided to ditch apache (
   using php-fpm). I should still be fine though right?
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607071)
 * Right [@c3mdigital](https://wordpress.org/support/users/c3mdigital/) ? 🙂
 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607078)
 * [@braddor](https://wordpress.org/support/users/braddor/)
 * If your using Nginx on its own the[ plugin ](http://wordpress.org/extend/plugins/nginx-compatibility/)
   will make WordPress think you have mod_rewrite enabled and allow you to use pretty
   permalinks.
 * There is a sample server config file included with the plugin and a very good
   article on using Nginx with php-fpm and Apc here:
 * [http://interfacelab.com/nginx-php-fpm-apc-awesome/](http://interfacelab.com/nginx-php-fpm-apc-awesome/)
 *  Plugin Contributor [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * (@fredericktownes)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607159)
 * Formal nginx support is currently scheduled for 0.9.5 release.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: W3 Total Cache] NGINX support’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [Frederick Townes](https://wordpress.org/support/users/fredericktownes/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-w3-total-cache-nginx-support/#post-1607159)
 * Status: not a support question