Last active
April 6, 2016 18:34
-
-
Save igortik/a15b299bb7ede21ef91d985343bd7bcc to your computer and use it in GitHub Desktop.
Nginx configuration example for static data
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
server { | |
listen 80; | |
server_name static.domain.tld; | |
# Logs | |
# | |
error_log /var/www/logs/nginx_errors.log error; | |
access_log off; | |
# Path | |
# | |
set $root /var/www/static/; | |
# Root | |
# | |
root $root; | |
# Default requests | |
# | |
location / { | |
limit_req zone=static burst=200 nodelay; | |
try_files $uri =404; | |
etag off; | |
expires max; | |
log_not_found off; | |
access_log off; | |
} | |
location ~* \.(eot|ttf|woff|svg)$ { | |
limit_req zone=static burst=200 nodelay; | |
try_files $uri =404; | |
add_header Access-Control-Allow-Origin *; | |
etag off; | |
expires max; | |
log_not_found off; | |
access_log off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment