Skip to content

Instantly share code, notes, and snippets.

@fabianmarz
Created March 20, 2018 10:37
Show Gist options
  • Save fabianmarz/5d32692dde5e7373c8f7a7225fc49856 to your computer and use it in GitHub Desktop.
Save fabianmarz/5d32692dde5e7373c8f7a7225fc49856 to your computer and use it in GitHub Desktop.
Serve missing images from remote
location ~* \.(png|jpe?g|gif|ico)$ {
alias /path/to/public_html/;
expires 24h;
log_not_found off;
try_files $uri $uri/ @production;
}
location @production {
resolver 8.8.8.8;
proxy_pass http://<staging_url>.com/$uri;
}
@fabianmarz
Copy link
Author

I couldn't get this working without setting the alias. If anyone knows how to solve this, let me know.

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