Skip to content

Instantly share code, notes, and snippets.

@petertoi
Created October 5, 2020 17:55
Show Gist options
  • Save petertoi/66457cc018dfb6c9ad13d3877025b73f to your computer and use it in GitHub Desktop.
Save petertoi/66457cc018dfb6c9ad13d3877025b73f to your computer and use it in GitHub Desktop.
nginx snippet for proxying production assets from a local (or other) environment
location ~* \.(png|jpe?g|gif|ico)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
proxy_pass https://example.com/$uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment