How to config nginx to download html file instead of opening it?

Igor Sysoev is at rambler-co.ru
Tue Aug 25 13:46:28 MSD 2009


On Tue, Aug 25, 2009 at 11:29:57AM +0200, J?r?me Loyet wrote:

> Hi,
> 
> in the mime.types file, remove the extension html from the text/html
> file. It should do the trick.

It's better to set new "types" for location:

location /saveonly/ {
     types  { application/octet-stream  html; }
     ...
}


> ++ Jerome
> 
> 2009/8/25 jzhang <nginx-forum at nginx.us>:
> > Hello everyone,
> > I want to config the server when user access a html file, the browser would popup the Save File dialog,
> > instead of opening it in window. Your help will be appreciated greatly.
> >
> > Jason Zhang
> >
> > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,5148,5148#msg-5148
> >
> >
> >

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list