Laravel Valet: fetch missing images from production
Devron Baldwin
323

Hey Devron Baldwin -

Here is a working version that will serve the local version if it exists. I believe your implementation above always serves the remote version, even if the local version exists, so the below will fix that:

location ~* .(png|jpe?g|gif|ico|svg)$ {
expires 24h;
log_not_found off;
root '/Users/your-user-name-here/.valet/Sites/mixpanel/’;
    if (-f $request_filename) {
break;
}

try_files $uri $uri/ @production;
}
 location @production {
resolver 8.8.8.8;
proxy_pass https://example.com/$uri;
}