Created
January 10, 2012 16:36
-
-
Save agibralter/1589915 to your computer and use it in GitHub Desktop.
This file contains 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
server { | |
listen 8000; | |
server_name foo.com; | |
root /mnt/foo/current/public; | |
# Allow all assets to be cached by CloudFront and browsers. | |
add_header Cache-Control public; | |
# Default expires of 1 hour. | |
expires 1h; | |
# Only set far-future expires for assets with hashes. Note: since max_expire | |
# contains curly brackets in the regexp, we must use quotes. | |
location ~* "-[0-9a-f]{32}\.(ico|css|js|gif|jpe?g|png|svg)(\.gz)?$" { | |
expires max; | |
} | |
location ~* "-[0-9a-f]{32}\.(eot|ttf|otf|woff)(\.gz)?$" { | |
add_header Access-Control-Allow-Origin *; | |
expires max; | |
} | |
location ~* "\.(eot|ttf|otf|woff)(\.gz)?$" { | |
add_header Access-Control-Allow-Origin *; | |
} | |
} |
This file contains 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
server { | |
listen 8000; | |
server_name foo.com; | |
root /mnt/foo/current/public; | |
# Allow all assets to be cached by CloudFront and browsers. | |
add_header Cache-Control public; | |
# Default expires of 1 hour. | |
expires 1h; | |
# Only set far-future expires for assets with hashes. Note: since max_expire | |
# contains curly brackets in the regexp, we must use quotes. | |
location ~* "-[0-9a-f]{32}\.(ico|css|js|gif|jpe?g|png|eot|ttf|otf|woff|svg)(\.gz)?$" { | |
expires max; | |
} | |
if ($filename ~* "\.(eot|ttf|otf|woff)$"){ | |
add_header Access-Control-Allow-Origin *; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment