• aka4751

    (@aka4751)


    Hello kind people,

    When I activate W3TC I get an error asking me to “edit the file /current/nginx.conf and add the following rules above the WordPress directives…” – but there is no file by that name in that directory.

    The only nginx.conf file I have on the server is located in /.etc/nginx/ but that file has o “WordPress directives”…

    Thank you so much in advance for your help.

    Akko

    https://ww.wp.xz.cn/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Tecca

    (@tecca)

    The file in /etc/nginx should be the one you edit (or give permissions for W3TC to write to). W3 Total Cache can’t detect where the config is, so it usually points to a generic location.

    Thread Starter aka4751

    (@aka4751)

    I found the correct file to edit (it was in nginx/sites-available/), but after I add the code my website doesn’t load after I reboot the server (the site stays down). When I remove the code, there is no problem. Any idea what this could be? The code they’re asking me to add is:

    # 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;
    # END W3TC Browser Cache

    Tecca

    (@tecca)

    It depends on where you’re adding it. It should be inside of the server block, so make sure you see this before the end of the file: }

    Though it’s probably best to keep the W3TC configs in a separate file and include it in your config. So something like:

    # Includes W3 Total Cache configs
    include /etc/nginx/conf.d/w3tc.conf

    Create that file above, and put that line into your current server block. Then paste what W3TC wants you to paste inside of the new file you just created. It keeps things a bit neater and easier to follow.

    If you need a bit more help, paste your config(s) here or in a pastebin.

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

The topic ‘W3TC installation error (nginx)’ is closed to new replies.