Mime type text/plain

Hi,

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?

Thanks,
Frank

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,28379,28379#msg-28379

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 S.
http://sysoev.ru/en/

The default type is already in place inside the location part of the
config. Unfortunately this doesn’t help :frowning:

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,28379,28471#msg-28471

hmm i don’t know how to do that but if you tell me how i can try :slight_smile:

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,28379,28515#msg-28515

On Mon, Dec 07, 2009 at 05:09:28AM -0500, Helmi wrote:

hmm i don’t know how to do that but if you tell me how i can try :slight_smile:

http://nginx.org/en/docs/debugging_log.html


Igor S.
http://sysoev.ru/en/

On Sun, Dec 06, 2009 at 11:17:17PM -0500, Helmi wrote:

The default type is already in place inside the location part of the config. Unfortunately this doesn’t help :frowning:

Could you create a debug log ?


Igor S.
http://sysoev.ru/en/

2009/12/7 Helmi [email protected]:

hmm i don’t know how to do that but if you tell me how i can try :slight_smile:

Please look for the error_log directive documentation.

Jean-Baptiste Q.