add nginx config for static assets

This commit is contained in:
Nolan Lawson 2017-04-22 16:19:53 -07:00
parent 863a5ea716
commit 32f4c5319f
1 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,12 @@ server {
try_files $uri @proxy;
}
location /assets {
# Serve static, checksummed assets directly from nginx as a perf boost
root /home/mastodon/live/public;
add_header Cache-Control "public, max-age=31536000, immutable";
}
location @proxy {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;