Skip to content

Instantly share code, notes, and snippets.

@jahid32
Forked from chuckreynolds/wp-local-media-nginx.txt
Created October 6, 2023 09:01
Show Gist options
  • Save jahid32/7dfbc909208b3aa3b09cdc3ff2cf8917 to your computer and use it in GitHub Desktop.
Save jahid32/7dfbc909208b3aa3b09cdc3ff2cf8917 to your computer and use it in GitHub Desktop.
Local NGINX WordPress Media Uploads Fallback. Substitute {PROD} for the domain to use images from.
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ {
try_files $uri @image_fallback;
}
location @image_fallback {
proxy_pass http://{PROD};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment