Image 使用nginx代理外部图像

Image 使用nginx代理外部图像,image,proxy,nginx,Image,Proxy,Nginx,是否有一种方法可以使用nginx代理外部图像,而无需在本地下载和存储它们?例如,将图像的URI传递到我的代理服务器,如下所示: `http://myproxydomain.com/http://example.com/image.jpg` 并在我的站点上的图像的src属性中包含此URI。是--这是可能的: merge_slashes off; location ~ /(?<r>http://.*) { resolver 127.0.0.1;

是否有一种方法可以使用nginx代理外部图像,而无需在本地下载和存储它们?例如,将图像的
URI
传递到我的代理服务器,如下所示:

`http://myproxydomain.com/http://example.com/image.jpg`
并在我的站点上的图像的
src
属性中包含此
URI

是--这是可能的:

    merge_slashes off;

    location ~ /(?<r>http://.*) {
        resolver 127.0.0.1;
        proxy_pass $r;
    }
merge\u斜线删除;
位置~/(?http://.*){
分解器127.0.0.1;
代理通行证$r;
}
你是否应该做那件事是另一回事。让
merge\u斜线删除
可能不是一个好主意