Last active
January 18, 2018 21:14
-
-
Save petertoi/57872d1107c5d3dd5832da7fec2d1cff to your computer and use it in GitHub Desktop.
Nginx rewrite to request WordPress uploads from external domain
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 ~ ^/wp-content/uploads/(.*) { | |
if (!-f $request_filename) { | |
rewrite ^/wp-content/uploads/(.*)$ http://EXTERNAL_URL/wp-content/uploads/$1 redirect; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment