To add some basic asset caching to a private Nginx stack, add the following within the location /
block of your nginx.conf:
location ~* \.(js|css|jpg|jpeg|png|gif|js|css|ico|woff|woff2|svg)$ {
expires 1y;
etag off;
if_modified_since off;
add_header Cache-Control "public, no-transform";
}
If you want to cache everything without regard to the content type, then don't wrap the config in its own location block eg:
expires 1y;
etag off;
if_modified_since off;
add_header Cache-Control "public, no-transform";