设置nginx 响应头部,允许其他域名跨域访问数据.

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?

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 *; 
} 

http://serverfault.com/questions/162429/how-do-i-add-access-control-allow-origin-in-nginx