Created
October 5, 2020 17:55
-
-
Save petertoi/66457cc018dfb6c9ad13d3877025b73f to your computer and use it in GitHub Desktop.
nginx snippet for proxying production assets from a local (or other) environment
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)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; | |
proxy_pass https://example.com/$uri; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment