Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法用 nginx 代理外部图像而无需在本地下载和存储它们?即URI像这样将图像传递给我的代理服务器:
URI
`http://myproxydomain.com/http://example.com/image.jpg`
并将其包含在我网站上图像URI的src属性中。
src
是的——这是可能的:
merge_slashes off; location ~ /(?<r>http://.*) { resolver 127.0.0.1; proxy_pass $r; }
你是否应该这样做是另一回事。拥有merge_slashes off可能不是一个好主意。
merge_slashes off