I tried adding these lines to mime.types:
application/x-gtar tar.gz tgz tar.bz2 tbz2 tbz;
application/x-bzip2 bz2;
application/x-gzip gz;
But nginx reports "Content-Type: application/x-bzip2" for a tar.bz2 file. How can I fix it?
Additional question: what's the correct mime type for tar.bz2/tbz2 files? Different sources gave me all kinds of different answers: application/x-gtar, application/x-compressed-tar, application/x-bzip-compressed-tar, application/x-tar-bz2, application/x-bzip2, etc. Same for tar.gz/tgz
There's a disclaimer in
/etc/mime.types
file:This means that you should have
application/x-tar
to map tarballs instead of separate content-type for each compressing method.You can safely copy it from
/etc/mime.types
for instance.You probably can use the HttpHeadersMoreModule with some regular expression matching to override the
Content-Type
if the url ends with one of the extensions.According to the conf/mime.types, it seems that nginx doesn't support this mime types.