Skip to content

Instantly share code, notes, and snippets.

@jomurgel
Last active December 5, 2018 17:58
Show Gist options
  • Save jomurgel/4d774da056f9271edd28e4f30ad6f39f to your computer and use it in GitHub Desktop.
Save jomurgel/4d774da056f9271edd28e4f30ad6f39f to your computer and use it in GitHub Desktop.
Production images on local Valet
$ sudo nginx -s reload
# Load media in /uploads/ from devcsc.wpengine.com.
location ~ ^/wp-content/uploads/(?!bb-plugin)(.*) {
rewrite ^/wp-content/uploads/(.*)$ https://sitename.com/wp-content/uploads/$1 permanent;
}
# https://medium.com/@devron/laravel-valet-fetch-missing-assets-from-production-automatically-ffc007753945
location ~* \.(png|jpe?g|gif|ico|mp4|ogg|wav|mp3|mpeg)$ {
expires 24h;
log_not_found off;
try_files $uri $uri/wp-content/uploads/ @production;
}
location @production {
resolver 8.8.8.8;
# Production URL
proxy_pass https://sitename.com/$uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment