Skip to content

Instantly share code, notes, and snippets.

@TheLastCicada
Forked from jeremyfelt/proxy-production.conf
Last active February 28, 2020 22:42
Show Gist options
  • Save TheLastCicada/ee6775c5f269f5f5389f to your computer and use it in GitHub Desktop.
Save TheLastCicada/ee6775c5f269f5f5389f to your computer and use it in GitHub Desktop.
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
proxy_pass http://www.livesite.com/$uri;
}
@sc0ttkclark
Copy link

@jeremyfelt @TheLastCicada Any reason there's a $uri $uri/ in try_files, instead of just $uri?

@TheLastCicada
Copy link
Author

No good reason I can think of - especially for the file types in question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment