Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to configure .htc files to work on nginx

I'm trying to run rounded corners on <= IE8 using border-radius.htc located here. I've run the URL to the .htc file in my browser, and I can view the code so my path is correct in the css file. I'm using nginx to host my webpages.

Does anyone know how I can get this file to run so that the styling works in < IE9? I've read some here about MIME types for .htc extensions, but I don't know what to do for nginx or even if MIME type is the issue. If there is some other way to get the rounded corners without using an .htc file, I'm open to try that solution as well. Thanks.

like image 376
Chris22 Avatar asked Nov 15 '11 15:11

Chris22


2 Answers

I've found the answer, this solution. It's the 2nd post down on the thread.

Comment by [email protected], Oct 15, 2009

The directives are almost identical if you're using nginx. Open /etc/nginx/mime.types and add the following three lines inside your types {}declaration (in recent versions of nginx they're already there):

text/x-component htc;
application/x-shockwave-flash swf;
image/svg+xml svg;
like image 98
Chris22 Avatar answered Sep 20 '22 14:09

Chris22


Try something like this..

location = /border-radius.htc {
  default_type 'text/x-component';
  try_files $uri /border-radius.htc;
}

Note the actual file location is relative to your root path.

like image 30
Marco Avatar answered Sep 19 '22 14:09

Marco