-
-
Save aiiddqd/55419e049588be38eeac50e298fb7a36 to your computer and use it in GitHub Desktop.
Defer the loading of images to the production/live server if file not exist - NGINX
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
server { | |
# base nginx conf | |
location ~ ^/wp-content/uploads/(.*) { | |
try_files $uri @live_uploads; | |
} | |
location @live_uploads { | |
rewrite ^/wp-content/uploads/(.*)$ https://livewebsite.com/wp-content/uploads/$1 permanent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment