W3 Total Cache
Please include nginx rewrite rules for apache users (3 posts)

  1. Mayhem30
    Posted 3 years ago #

    Could you please include an option to display the nginx rewrite rules in the install tab (or add a hidden ?page=w3tc_install_nginx) page for us Apache users that would rather have our nginx 'frontend' handle the rewrites?

    Thank you.


  2. Mayhem30
    Posted 3 years ago #

    After doing some testing, I found some interesting results.

    If you let nginx handle all incoming connections and just proxypass php files to apache, pingdom.com was showing load times of 1.8 -> 2.2 ms - which is really good.

    However, I decided to add in the following config to see what would happen

    # Set a variable to work around the lack of nested conditionals
             set $cache_uri $request_uri;
             # POST requests and urls with a query string should always go to PHP
             if ($request_method = POST) {
                set $cache_uri 'no cache';
             if ($query_string != "") {
                set $cache_uri 'no cache';
             location / {
                try_files /wp-content/cache/page_enhanced/$host/$cache_uri/_index.html $uri @backend;

    @backend is my block that handles passing php requests off to apache for processing.

    This is what pingdom.com shows now : http://i49.tinypic.com/2ngzif4.png

    The difference is night and day! The blog pages load instantly - no more ~1.5 sec pause before the content displays.

    So if your running a similar setup (nginx up front, apache backend) you should really mess around with the 'try_files" directive and get it to check for the static resource first.

  3. Pothi Kalimuthu
    Posted 3 years ago #

    Nice example. Thanks for sharing the code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic