Currently I need to use tricks since I have multiple locations in my site config.<div><br></div><div>e.g.</div><div><br></div><div>=====================================</div><div><br><div><br></div><div><div><div>location ~* /a {</div>
<div>    location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div><div>        expires 1y;</div><div>    }</div><div>}</div><div><br></div><div>location ~* /b {</div><div>    location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div>
<div>        expires 1y;</div><div>    }</div><div>}</div><div><br></div><div>location ~* /c {</div><div>    location ~* ^/.*\.(?:css|js|jpg|jpeg|gif|png)$ { </div><div>        expires 1y;</div><div>    }</div><div>}</div>
</div></div><div><br></div><div><br></div><div><div>=====================================</div></div><div><br></div><div>Are there any better way to write it?</div><div><br></div></div><div><br></div><div>Thanks.</div>