Last active
February 20, 2024 16:48
-
-
Save serguk89/c68640dd5bc50740fd1feaf055c1a08a to your computer and use it in GitHub Desktop.
nginx wordpress uploads redirect
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 ( !-e $request_filename ) { | |
rewrite "^(.*)/wp-content/uploads/(.*)$" "https://***.com/wp-content/uploads/$2" redirect; | |
} | |
} | |
location ~ "^(.*)/wp-content/cache/thumb/(.*)$" { | |
if ( !-e $request_filename ) { | |
rewrite "^(.*)/wp-content/cache/thumb/(.*)$" "https://***.com/wp-content/cache/thumb/$2" redirect; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment