Apache mod_substitute json响应正文 [英] Apache mod_substitute json response body

查看:91
本文介绍了Apache mod_substitute json响应正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用apache mod_substitute模块来更改我的json响应正文.但这似乎不起作用

I am using apache mod_substitute module to alter my json response body . But it doesn't seem to be working

AddOutputFilterByType替换text/html text/plain text/xml text/css text/javascript application/javascript application/json

AddOutputFilterByType SUBSTITUTE text/html text/plain text/xml text/css text/javascript application/javascript application/json

替换s | abc-docs | xyz-docs | ni

Substitute s|abc-docs|xyz-docs|ni

我已经使用上面的代码执行相同的操作.我的json响应将包含abc-docs作为名为url ex的键的值:{"url":"abc-docs"}

I have used the above code to perform the same . My json response would contain abc-docs as a value for a key called url ex : {"url":"abc-docs"}

我希望响应到达客户端后将包含{"url":"xyz-docs"}.

I was expecting the response to contain {"url":"xyz-docs"} once it reaches the client .

请告知

推荐答案

这有效.在特定于反向代理的位置标记下添加了Substitute指令

This works . Added the Substitute directive under a Location tag specific to the reverse proxy

这篇关于Apache mod_substitute json响应正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆