feat: media host redirection
This commit is contained in:
@@ -41,6 +41,19 @@ server {
|
||||
fastcgi_pass php;
|
||||
}
|
||||
|
||||
location ~* ^/wp-content/uploads/ {
|
||||
set $media_host "${WPSTACK_MEDIA_HOST}";
|
||||
try_files $uri @remote_media;
|
||||
}
|
||||
|
||||
location @remote_media {
|
||||
if ($media_host = "") {
|
||||
return 404;
|
||||
}
|
||||
|
||||
return 302 $media_host$request_uri;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
|
||||
expires max;
|
||||
log_not_found off;
|
||||
|
||||
Reference in New Issue
Block a user