Wrong mimetype when served from nginx

Cédric Jeanneret nginx at tengu.ch
Fri Jul 10 06:00:06 UTC 2015


Hello,

I have a small issue with my nginx (1.2.1) configuration:
some files are served as "application/octet-stream" while they are
detected as "text/plain" by "mimetype <file>" command.

File names are just "1", "2", and so on.

Is there a way to enforce mimetype for those files?

I thought about something like this:

location ~ /path/to/file/[0-9]+ {
  types {}
  default_type text/plain;
}

but after that, I get a 404 — what did I wrong?

Thanks for your support!

Cheers,

C.



More information about the nginx mailing list