# Caching and Compression gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_proxied any; gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon image/bmp image/webp image/jpeg image/png image/gif; gzip_vary on; # X-Content-Type-Options add_header X-Content-Type-Options "nosniff" always; # Handling versioned static files location ~* ^(.+)\.(\d+)\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip|webp)$ { try_files $uri $1.$3 =404; etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "max-age=31536000, public"; } # Handling non-versioned static files location ~* \.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|eot|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|svg|swf|tar|tgz|ttf|txt|wav|woff|woff2|xls|xlsx|zip|webp)$ { etag on; if_modified_since exact; add_header Pragma "public"; add_header Cache-Control "max-age=31536000, public"; }