I like NGINX but how do I set the Access-Control-Allow-Origin header so I can use web-fonts from my subdomain on my main domain?

link|improve this question

1  
ah finally found the answer location / { add_header Access-Control-Allow-Origin "*"; } – Chris M Jul 20 '10 at 22:59
feedback

1 Answer

up vote 12 down vote accepted

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

location ~* \.(eot|ttf|woff)$ {
    add_header Access-Control-Allow-Origin *;
}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.