nginx多个静态内容服务器上的子域与url重写

我有一台服务器与nginx的前端和apache的后端。

我需要设置nginx来从其他两台服务器返回图像

  http://example.com/images/*.jpg  - > http://i1.example.com/images/*.jpg 
  http://example.com/images/*.jpg  - > http://i2.example.com/images/*.jpg 

图像文件夹在两台服务器上是相同的。

早些时候我问了这个问题,并得到答案

 
上游后端{ 
    服务器i1.example.com;
    服务器i2.example.com;
 } 

location / images / {
proxy_pass http:// backend / ;
#restconfiguration
}
在我的configuration。 这行得通。

但我需要一些其他解决scheme,需要在头文件中看到i1.example.com和i2.example.com,现在我只能看到example.com头文件。 可能吗?
我会很感激任何意见。