我有一个Apache 2.2,承载一个专有(商业)authentication模块。 这些模块会查看每个请求,如果在后端身份validation软件中被标记和“匿名确定”,则可以让它们通过。
一个这样的匿名资源是一个小型的gif,由面向我们的Apaches的load balacer查询,命名为/lb.gif 。
当authentication软件出现问题时,其模块不会采取任何措施阻止所有内容,包括我们的负载均衡器信标文件。 负载平衡器认为该站点已closures,并停止向其发送stream量。
我希望Apache不要将这个特定的请求发送给其他模块。 这种作品:
RewriteEngine On RewriteRule ^/lb.gif$ - [R=200]
看到这个,Apache返回一个200结果的HTML:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>200 OK</title> </head><body> <h1>OK</h1> <p>The server encountered an unknown error, possibly due to misconfiguration. Contact the server administrator: [no address given]<p> More information about this error may be available in the server error log.</p> </body></html>
它满足负载平衡器,但是混淆了我们用于监视的另一个工具。
有没有办法告诉Apache停止处理并立即返回一个资源,而不是发送请求进一步向下的模块链?
您可能会认为,当您的身份validation模块正在执行时,负载均衡器检查失败正是您所需要的…
我过去使用的解决方法是在Apacheconfiguration中设置一个单独的VirtualHost,您可以在其中禁用身份validation,并假设loadbalancer http客户端发送HTTP 1.1 Host头,通过轮询validationWeb服务器节点的正常运行时间VirtualHost而不是你的主站点。