Last active
December 5, 2018 17:58
-
-
Save jomurgel/4d774da056f9271edd28e4f30ad6f39f to your computer and use it in GitHub Desktop.
Production images on local Valet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo nginx -s reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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