用mod_proxy_html替换json编码的URL

时间:2013-04-09 13:16:02

标签: json reverse-proxy mod-proxy-html

我目前安装了反向代理。阿帕奇正在做这项工作。所以我配置了mod_proxy以适应网址。我还使用mod_proxy_html来调整HTML和JavaScript链接。现在我遇到了一个ajax调用的问题,它返回一个json编码的url。

有没有办法用mod_proxy_html做到这一点? 有人建议如何调整这些网址吗?

提前谢谢

1 个答案:

答案 0 :(得分:3)

我找到了另一种替代json-links的方法:

我使用了apache模块 mod_substitute 。 如果将 application / json 声明为OutputFilter,则代理将替换链接。 mod_substitute的语法类似于unix- / linux-command sed 的语法。

一个小例子:

AddOutputFilterByType SUBSTITUTE application/json Substitute "s|zuersetzen|ersetzt|n"

以下链接作为参考: http://httpd.apache.org/docs/2.4/mod/mod_substitute.html

相关问题