2

If I have:

# ...
http {
  include mime.types;
  # ...
  types {
  }
}
# ...

will the second types overwrite the types in the include or append to the mime types?

2 Answers 2

1

it will overwrite, which is a pain. When I've needed to give specific mime-types to specific files, I've done it by having a regex to match only those files, and then overwritten the type map for only those files:

location ~* ^.+\.(manifest|appcache)$ {
    types         { }
    default_type  text/cache-manifest;
}
0
1

It appears this has gotten easier since the question was asked. From https://stackoverflow.com/a/20566966:

You just need to specify additional types on the same level as your mime.types include:

include mime.types;
types {
    # here is additional types
}
1
  • its look like user accepted the answer already Jul 24, 2014 at 5:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .