转发代理与URL重写

如果这是一个新手问题,我很抱歉 – 我不能相信它的辛苦,所以我必须错过一些东西。

我有一个应用程序在https://example.com/application/* 。 它使用来自https://reference.com/maps/*的PNG

我想要的是,在https://example.com/maps/*的调用下,从reference.com返回相应的PNG,并在可能的情况下顺便caching内容。

我尝试了反向代理

 ProxyPass /maps/ https://reference.com/maps/ 

现在,如果在我的源文件中有<img src="/maps/PNG1.png">浏览器会显示我https://reference.com/maps.PNG1.png ,但它是浏览器正在执行抓取,不是服务器。

我尝试使用http://httpd.apache.org/docs/2.4/rewrite/proxy.html的示例转发代理:

 RewriteEngine on RewriteBase "/maps/" RewriteRule "^(.*)$" "https://reference.com/maps/$1" [P] ProxyPassReverse "/maps/" "https://example.com/maps/" 

重写日志显示的是

 (2) init rewrite engine with requested uri /maps/PNG1.png (1) pass through /maps/PNG1.png 

我错过了什么? 有复杂的 – 这是所有的SSL(是的,SSLProxy打开),通过PNG服务器的调用使用客户端身份validation,但我不认为这是相关的。 呵呵,它使用的是IBM HTTP Server,但我认为指令结构和Apache一样。

线索,任何人?