Files with a hash in their name never change, so the browser should not ask about them.
location ~* \.[0-9a-f]{8}\.(css|js|woff2)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
This matches names like app.4f2a9c1d.js and gives them a one-year lifetime. immutable tells browsers that support it not to revalidate the file when the user reloads the page. It is only correct when the file name changes with every content change, which build tools do with a content hash. A fixed name such as style.css with this header can get stuck in browsers for a year. Remember that add_header in a location replaces the headers inherited from the level above.
Further reading: MDN: Cache-Control header
Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it