LocationMatch的问题,将Regex放在Apache中的位置标头中

时间:2019-03-10 21:07:15

标签: apache httpd.conf mod-proxy

我们正在使用Apache中的LocationMatch指令运行Apache Proxy,效果非常好。基本上,在我们的服务器上以/ AAA_AAA1234 /格式访问的所有内容都会被代理。它起作用,除非远程服务器将位置放入HTTP标头中,在这种情况下,它将字面意义上将Regex放入位置标头中。不知道为什么吗?

运行代理的httpd.conf部分:


ProxyPassMatch "^/[A-Z][A-Z][A-Z]_[A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]/" "https://servertoproxy.com"


<LocationMatch "^/[A-Z][A-Z][A-Z]_[A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]/">
   RequestHeader set Front-End-Https "On"
   ProxyPassReverse /AAA_AAA1234/
   SetOutputFilter  proxy-html
   LogLevel debug

   SetOutputFilter INFLATE;SUBSTITUTE;proxy-html;DEFLATE
</LocationMatch>

由Apache服务器返回:

HTTP/1.1 302 Found
Cache-Control: private
Location: https://www.apacheserverdomain.com^/[A-Z][A-Z][A-Z]_[A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]/Logout/InvalidNavigation

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/AAA_AAA1234/Logout/InvalidNavigation">here</a>.</h2>
</body></html>

0 个答案:

没有答案