Configuration by location
location ~ \.html$ { add_header 'Cache-Control' 'no-cache'; } location ~ \.(js|css|gif|jpg|jpeg|png|bmp|swf)$) { access_log off; expires 7d; }
Arranged in the location
location ^~ /testpath { if ($uri ~ \.html$) { add_header 'Cache-Control' 'no-cache'; } if ($uri ~ \.(js|css|gif|jpg|jpeg|png|bmp|swf)$) { access_log off; expires 7d; } ... }