Skip to content

Instantly share code, notes, and snippets.

@JayWood
Created January 13, 2019 03:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayWood/dbe84556ff2b5a4b451fc90dc7144339 to your computer and use it in GitHub Desktop.
Save JayWood/dbe84556ff2b5a4b451fc90dc7144339 to your computer and use it in GitHub Desktop.
Don't want to download your uploads from the remote, me either...
# Directives to send expires headers and turn off 404 error logging.
location ~* .(js|css|png|jpg|jpeg|gif|ico|mp3|mov|tif|tiff|swf|txt|html)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
# replace www.livesite.com with the production site URL
proxy_pass https://example.com/$uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment