Skip to content

Instantly share code, notes, and snippets.

@mckernanin
Last active November 17, 2023 09:27
Show Gist options
  • Save mckernanin/f75f8bcd74af84730723 to your computer and use it in GitHub Desktop.
Save mckernanin/f75f8bcd74af84730723 to your computer and use it in GitHub Desktop.
Example nginx config to get WordPress uploads from remote if they don't exist locally
# save space, and grab uploads from the live site
location /wp-content/uploads/ {
if (!-e $request_filename){
rewrite ^/wp-content/uploads/(.*) http://yourlivesite.com/wp-content/uploads/$1 redirect;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment