Custom configuration

Cliff Wells cliff at develix.com
Tue Mar 27 22:15:37 UTC 2012


On Tue, 2012-03-27 at 23:46 +0200, Adnan RIHAN wrote:

> It's working well, but his website is now ugly, because the
> instruction also applies for .css O_O
> 
> > root at shadow [/etc/cpnginx/custom]# cat domain.com
> > types {
> >     application/octet-stream mp3;
> > }

When you use the types directive, it *replaces* all the types with
whatever you specify.  You don't define any mimetypes besides mp3, so
Nginx uses the default (application/octet-stream) for anything it
doesn't recognize, which now includes css.

Try something like this instead:

location ~* \.mp3$ {
  types { application/octet-stream mp3; }
}

See also:
http://wiki.nginx.org/HttpCoreModule#types

As an aside, you could also just edit /etc/nginx/mime.types and change
the type for mp3 files.

Regards,
Cliff




More information about the nginx mailing list