Updating mime-types in nginx

What needs to be done to update mime-types for nginx?
Currently, not all types specified in compressMimeTypes are present in the mailcap package. As a result, gzip/brotli compression does not work for some types.

1 Like

Looks like a handful of updates are just pending a review of impacts throughout nixpkgs. Iā€™d start by picking up where that PR left off.

Package mailcap uses new type values for javascript and xml, which are not supported in nginx - application/javascript and text/xml. See here for more information - #1407 (Should application/javascript be text/javascript in mime.types) ā€“ nginx
And, instead of the recommended type image/x-icon, image/vnd.microsoft.icon is used - ICO (file format) - Wikipedia
Those some meme-types are missing:

  • application/x-java-archive-diff jardiff
  • application/x-ssa ass ssa
  • application/x-makeself
  • application/x-subrip srt
  • application/x-web-app-manifest+json
  • video/mp2t bdmv clpi cpi m2t m2ts mpl mpls
    and others.
    Also, nginx developers do not recommend using large lists of mime-types.
    Is it possible to make a separate list of mime-types in NixOS, which will be easier to update than the list in mailcap or nginx.