我可以关闭 Apache 指令然后在包含中将其打开吗?
我有一个包含常见配置项的 VirtualHost 块,其中一个指令是 ProxyPreserveHost。
我可以“按程序”关闭 Rewrite 指令的 ProxyPreserveHost 然后让 include 将其重新打开吗?例如:
<VirtualHost *:80>
ServerName www.blah.com
...
...
ProxyPreserveHost off
RewriteRule /somepath http://otherhost/otherpath [P]
Include /path/to/file/turning-on-ProxyPreserveHost
</VirtualHost>
其他主机位于 CDN 上,并且保留该主机会产生一些名称解析问题,该问题不允许在主机命名空间中代理内容。
ProxyReserveHost 仅允许在服务器配置或 VirtualHost 中使用。看起来我不能有选择地关闭 ProxyPass 和 ProxyPassReverse 指令(封装在 mod_rewrite 的代理标志中)。
I have a VirtualHost block that includes common configuration items, one directive is ProxyPreserveHost.
Can I "procedurally" turn off ProxyPreserveHost for a Rewrite directive then have the include turn it back on? For example:
<VirtualHost *:80>
ServerName www.blah.com
...
...
ProxyPreserveHost off
RewriteRule /somepath http://otherhost/otherpath [P]
Include /path/to/file/turning-on-ProxyPreserveHost
</VirtualHost>
The otherhost is on a CDN and preserving the host is creating some name resolution issue that is not allowing the proxying of content in the host namespace.
ProxyReserveHost is only allowed in a Server Config or VirtualHost. It doesn't look like I can selectively turn it off for the ProxyPass and ProxyPassReverse directives (encapsulated in the proxy flag of mod_rewrite).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下内容是在互联网上找到的,解决了我的困境。顺便说一句,有一个开放的功能请求,要求在 Apache HTTPD 项目中的位置和目录级别配置 ProxyPreserveHost。
The following, found on the internet, addressed my dilemma. As an aside, there is an open feature request to make
ProxyPreserveHost
configurable at the Location and Directory level within the Apache HTTPD project.