When using Laravel's Homestead, one thing that can be a pain is having to constantly re-add configuration rules in your site's nginx config upon provisioning. This is infinitely worse when you have to configure multiple sites 😤 . However with this setup, you can put those days behind you. The following instructions focus on location, however this can be applied to pretty much anything.
The location rule here pulls images from your live site if they don't exist on your local dev environment. Helps reduce GBs of unnecessary assets on your local machine In order for the following code to work, your site folder must have the same name as the live site.
-
Inside of the ~/Homestead/scripts folder, edit "serve-laravel.sh".
-
Insert the accompaning code in its respective places.