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.
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
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.