Here's something often used in Django.
When using Mezzanine and directing static or media files to a CDN, you might frequently encounter CORS errors in Firefox (for example, glyphicon might not be displayed). This is a countermeasure for that.
location ~* ^/static(/(.+\.(eot|ttf|woff)))$ {
add_header Access-Control-Allow-Origin *;
alias /var/django/mydjangoproject/staticfiles$1;
break;
}
location ~ ^/static(/(.+))?$ {
alias /var/django/ydjangoproject/staticfiles$1;
break;
}
location ~ ^/media(/(.+))?$ {
alias /var/django/ydjangoproject/mediafiles$1;
break;
}
Comments