Created
March 20, 2018 10:37
-
-
Save fabianmarz/5d32692dde5e7373c8f7a7225fc49856 to your computer and use it in GitHub Desktop.
Serve missing images from remote
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
location ~* \.(png|jpe?g|gif|ico)$ { | |
alias /path/to/public_html/; | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
proxy_pass http://<staging_url>.com/$uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I couldn't get this working without setting the
alias
. If anyone knows how to solve this, let me know.