I have an nginx server and can\'t seem to find any information on how to send Vary: Accept-Encoding headers for CSS and JS files. Does anyone have info about this?
Thank
If you've tried the other answers and are still seeing vary off (e.g. if you are testing speed of your page using GTMetrix), the following might help:
Make sure all your gzip_types are also set in /etc/nginx/nginx.conf http section.
The server block in /etc/nginx/sites-available/* is one place where you can set the vary header and gzip_types, but depending on how you have your site setup you may be processing and returning files before they reach that bit of config.
In /etc/nginx/nginx.conf you will find an 'http' section - in here, there is also a gzip_types and gzip_vary.
For me - CSS and JS are static files and were being served up before hitting the (wordpress) nginx sites-available file (I have varnish in front of it).
So adding the full list of gzip_types to the http section in nginx.conf fixed my issue.