Project

General

Profile

Actions

mimetype.assign option

Description

mimetype.assign

list of known mimetype mappings from file extension to mimetype (and returned in HTTP response header Content-Type)
Note: lighttpd 1.4.71 and later provide a small set of the most common extension mappings if lighttpd.conf does not set mimetype.assign
Note: if no file extension mapping matches the response file, then "application/octet-stream" is used

Example:

mimetype.assign   = ( ".png"  => "image/png",
                      ".jpg"  => "image/jpeg",
                      ".jpeg" => "image/jpeg",
                      ".html" => "text/html",
                      ".txt"  => "text/plain;charset=utf-8" )

The list is compared top down and the first match is taken (since lighttpd 1.4.46, only if mimetype.assign contains 16 entries or fewer). This is important if you have matches like:

      ".tar.gz" => "application/x-tgz",
      ".gz" => "application/x-gzip",

The matches are suffix matches, so files without extensions can also be assigned mimetypes

      "README" => "text/plain",

If you want to set a default mimetype, set a value for an empty string as the last entry in the list.

     ...,
     "" => "text/plain" )

See Also

Updated by gstrauss 2 months ago · 11 revisions