Try it first cause I haven't tested this before.
conf file /etc/nginx/img-cache.conf
for example
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires max;
}
server
server {
#bla bla
include /etc/nginx/img-cache.conf;
#bla bla
}