Skip to content

Instantly share code, notes, and snippets.

@igortik
Last active April 6, 2016 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igortik/a15b299bb7ede21ef91d985343bd7bcc to your computer and use it in GitHub Desktop.
Save igortik/a15b299bb7ede21ef91d985343bd7bcc to your computer and use it in GitHub Desktop.
Nginx configuration example for static data
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