Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 使用反向代理更改响应的内容_Apache - Fatal编程技术网

Apache 使用反向代理更改响应的内容

Apache 使用反向代理更改响应的内容,apache,Apache,我使用ApacheModu代理(反向代理)来获取我拥有的网站的内容。我希望能够在将请求内容和头发送回客户端之前更改请求内容和头。我在网上搜索了一些例子,但没有找到 有没有办法做这样的事 您可以使用模式_替换来更改/替换响应中的文本。但使用起来有点棘手 <Location /> AddOutputFilterByType SUBSTITUTE text/html # "foo=k,bar=k" -> "foo/bar=k" Substitute "s|foo=(\w+),bar

我使用ApacheModu代理(反向代理)来获取我拥有的网站的内容。我希望能够在将请求内容和头发送回客户端之前更改请求内容和头。我在网上搜索了一些例子,但没有找到


有没有办法做这样的事

您可以使用模式_替换来更改/替换响应中的文本。但使用起来有点棘手

<Location />
AddOutputFilterByType SUBSTITUTE text/html
# "foo=k,bar=k" -> "foo/bar=k" 
Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
</Location>

AddOutputFilterByType替换文本/html
#“foo=k,bar=k”->“foo/bar=k”
替换为“s | foo=(\w+),bar=\1 | foo/bar=$1”