Viewing 8 replies - 1 through 8 (of 8 total)
  • Nginx + PHP-FPM : not working

    What do you expect to happen and what’s happening now?

    Does this plugin install? If yes, can you configure the various settings in it?

    Thread Starter phoenix13

    (@phoenix13)

    Set expires header, cache control header, set eTag : doesn’t work πŸ™

    Nothing in header for http://web-sniffer.net πŸ™

    “Does this plugin install? ” : Yes

    If yes, can you configure the various settings in it? Yes, but not for expires header, cache control header, set eTag

    eTag will not work, unless your Nginx version is the latest (1.4+). On other things, Nginx needs to be restarted to apply the settings. Additionally, the nginx.conf file generated by this plugin needs to be inserted into the site’s vhost file. Did you insert in and restart Nginx?

    Thread Starter phoenix13

    (@phoenix13)

    Yes for all.

    Doesn’t work (1) and work (2)…

    (1) :

    # BEGIN W3TC Page Cache cache
    location ~ /wp-content/cache/page_enhanced.*html$ {
        expires modified 3600s;
        add_header Vary "Accept-Encoding, Cookie";
        add_header Pragma "public";
        add_header Cache-Control "max-age=3600, public";
    }
    location ~ /wp-content/cache/page_enhanced.*gzip$ {
        gzip off;
        types {}
        default_type text/html;
        expires modified 3600s;
        add_header Vary "Accept-Encoding, Cookie";
        add_header Pragma "public";
        add_header Cache-Control "max-age=3600, public";
        add_header Content-Encoding gzip;
    }
    # END W3TC Page Cache cache
    # BEGIN W3TC Browser Cache
    gzip on;
    gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
    location ~ \.(css|htc|js|js2|js3|js4)$ {
        expires 31536000s;
        add_header Pragma "public";
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }
    location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ {
        expires 3600s;
        add_header Pragma "public";
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }
    location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ {
        expires 31536000s;
        add_header Pragma "public";
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }
    # END W3TC Browser Cache
    # BEGIN W3TC Page Cache core
    rewrite ^(.*\/)?w3tc_rewrite_test/?$ $1?w3tc_rewrite_test=1 last;
    set $w3tc_rewrite 1;
    if ($request_method = POST) {
        set $w3tc_rewrite 0;
    }
    if ($query_string != "") {
        set $w3tc_rewrite 0;
    }
    if ($request_uri !~ \/$) {
        set $w3tc_rewrite 0;
    }
    if ($http_cookie ~* "(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)") {
        set $w3tc_rewrite 0;
    }
    set $w3tc_enc "";
    if ($http_accept_encoding ~ gzip) {
        set $w3tc_enc _gzip;
    }
    if (!-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index.html$w3tc_enc") {
      set $w3tc_rewrite 0;
    }
    if ($w3tc_rewrite = 1) {
        rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index.html$w3tc_enc" last;
    }
    # END W3TC Page Cache core

    (2)

    # Gzip
    gzip            on;
    # for (IE < 6)
    gzip_disable    "MSIE [1-6].(?!.*SV1)";
    gzip_vary       on;
    gzip_comp_level 3;
    gzip_proxied    any;
    gzip_buffers    16 8k;
    gzip_types text/plain text/html text/css application/json  application/x-javascript text/xml application/xml application/xml+rss  text/javascript;
    
    # Cache client
    expires 30d;
    add_header Pragma public;
    add_header Cache-Control β€œpublic”;
    try_files $uri @fallback;
    
        # set a nice expire for assets
        location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
            access_log off;
            expires    max;
            add_header Cache-Control public;
                  fastcgi_hide_header Set-Cookie;
        }
    
        ## These locations would be hidden by .htaccess normally
            autoindex off;
            location /wp-includes/  { deny all; }
            location = /readme.html { deny all; }
            location = /readme.txt { deny all; }
            location = /install.php { deny all; }
            location = /wp-config.php   { deny all; }
            location  /.                { return 404; }
    
         ## permit direct accces to .ht files
            location ~ /\.ht {
                    deny  all;
            }

    On Plesk Panel 11.5…

    Why doesn’y working in (1) ? πŸ™

    You might turn on debugging in Nginx to see what’s going with (1).

    The same problem with me, i don’t know why. Please help me

    Thread Starter phoenix13

    (@phoenix13)

    W3 Total Cache error: It appears Page Cache URL rewriting is not working. Please verify that all configuration files are included in the configuration file (and that you have reloaded / restarted nginx).
    Unfortunately disk enhanced page caching will not function without custom rewrite rules. Please ask your server administrator for assistance. Also refer to the install page for the rules for your server.

    Technical info
    nginx configuration file contains rules to rewrite url http://www.example.com/w3tc_rewrite_test into http://www.example.com/?w3tc_rewrite_test which, if handled by plugin, return “OK” message.
    The plugin made a request to http://www.example.com/w3tc_rewrite_test but received:
    404 Not Found
    instead of “OK” response.

    Thread Starter phoenix13

    (@phoenix13)

    And in header ( with web-sniffer.net )… πŸ™

    Last-Modified : Thu, 01 Jan 1970 00:00:00 GMT

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Nginx PHP-FPM : not working :(’ is closed to new replies.