FIreHAzaR:-D CRiB

This is not a blog. This is my diary.

Current Posts

  1. Apache configuration to support @font-face

    In apache.conf:

    
    AddType application/vnd.ms-fontobject .eot
    AddType font/ttf .ttf
    AddType font/otf .otf
    
    <FilesMatch "\.(ttf|otf|eot)$">
      <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
      </IfModule>
    </FilesMatch>
    

    Labels: ,

  2. Nginx configuration to support @font-face

    Nginx has to be compiled with http://wiki.nginx.org/NginxHttpHeadersModule. Then you can do this:

    
    server {
      location ~* \.(eot|ttf|woff)$ {
        add_header Access-Control-Allow-Origin *;
      }
    }
    

    Or inside virtual host location use:

    
    location {
      if ($request_filename ~* ^.?/([^/]?)$) {
        set $filename $1; 
      }
    
      if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$) {
        add_header Access-Control-Allow-Origin *;
      }
    }
    

    Labels: ,