Skip to content

Instantly share code, notes, and snippets.

@efontan
Created November 9, 2018 18:04
Show Gist options
  • Save efontan/471449e6f090e25193975976df205e6c to your computer and use it in GitHub Desktop.
Save efontan/471449e6f090e25193975976df205e6c to your computer and use it in GitHub Desktop.
Nginx config for static content
server {
listen 80;
server_name localhost;
location /static-content/ {
alias /home/user/static-content/;
add_header "Access-Control-Allow-Origin" *;
add_header Timing-Allow-Origin *;
expires 14d;
add_header Pragma public;
add_header Cache-Control "public";
add_header Vary Accept-Encoding;
# Allowed only GET HTTP method
limit_except GET {
deny all;
}
}
gzip on;
gzip_types text/css application/x-javascript text/javascript;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment