我正在为 Web 应用程序编写反向代理。我需要重写一些 Web 应用程序响应以匹配公共 URL。它对 GET api 响应很有效;但对 PUT api 响应无效。对于 PUT 请求,替代规则将被忽略。为什么?
Define proxy_servername proxy.test
Define project_servername project.test:8080
<VirtualHost *:80>
ServerName ${proxy_servername}
ProxyPass / http://${project_servername}/
ProxyPassReverse / http://${project_servername}/
ProxyHTMLEnable on
SetOutputFilter INFLATE;proxy-html;DEFLATE
AddOutputFilterByType SUBSTITUTE text/html application/json application/javascript text/xml application/xml
## Treat absolute url
Substitute "s,http://${project_servername}/,http://${proxy_servername}/,i"
RequestHeader unset Accept-Encoding
</VirtualHost>