Skip to content

Instantly share code, notes, and snippets.

@ncole458
Created April 20, 2016 05:28
Show Gist options
  • Select an option

  • Save ncole458/a11ebb9b85a556923e06271bc3834c21 to your computer and use it in GitHub Desktop.

Select an option

Save ncole458/a11ebb9b85a556923e06271bc3834c21 to your computer and use it in GitHub Desktop.
CORS for Django /media (FireFox fix)
# Your Django project's media files - amend as required
location /media {
if ($request_filename ~* ^.*?/([^/]*?)$) {
set $filename $1;
}
if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
add_header Access-Control-Allow-Origin *;
}
alias /django/django_project/media;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment