Mime type text/plain

Igor Sysoev igor at sysoev.ru
Sun Dec 6 22:20:14 MSK 2009

On Sun, Dec 06, 2009 at 10:36:02AM -0500, Helmi wrote:

> i'm trying to get some files delivered via nginx. These files are textfiles containing HTML code. They don't have any file extension (and i can't change that due to special reasons). I'd like to deliver them with Content-Type text/html instead of text/plain which is chosen bei nginx due to reasons i don't know.
> I've set default content type to text/html and also do explicitly set the conten type via add/header. Unfortunately the text/plain content type get's set before what results in a a header like this. "Content-Type text/plain text/html". In Safari this leads to a plain text display of the code instead of rendering the website.
> How can i overwrite the content type to text/html for files without extenions?

  location /some/ {
      default_type  text/html;

Igor Sysoev

More information about the nginx mailing list