Created
January 30, 2015 14:51
-
-
Save e-kolpakov/05e32a1d78627ea21476 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location ~ ^/static/(?P<file>.*) { | |
| root /edx/var/edxapp/; | |
| try_files /staticfiles/$file /course_static/$file =404; | |
| # return a 403 for static files that shouldn't be | |
| # in the staticfiles directory | |
| location ~ ^/static/(?:.*)(?:\.xml|\.json|README.TXT) { | |
| return 403; | |
| } | |
| # http://www.red-team-design.com/firefox-doesnt-allow-cross-domain-fonts-by-default | |
| location ~ "/static/(?P<collected>.*\.[0-9a-f]{12}\.(eot|otf|ttf|woff))" { | |
| expires max; | |
| try_files /staticfiles/$collected /course_static/$collected =404; | |
| } | |
| # Set django-pipelined files to maximum cache time | |
| location ~ "/static/(?P<collected>.*\.[0-9a-f]{12}\..*)" { | |
| expires max; | |
| # Without this try_files, files that have been run through | |
| # django-pipeline return 404s | |
| try_files /staticfiles/$collected /course_static/$collected =404; | |
| } | |
| # Expire other static files immediately (there should be very few / none of these) | |
| expires epoch; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment