How do I add Access-Control-Allow-Origin in NGINX?

设置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 Then you can do this

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


电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.