theweakgod commented on issue #10517: URL: https://github.com/apache/apisix/issues/10517#issuecomment-1822330081
> > > 我的上游是一个 php 网络服务器,它不执行任意代码。但你的问题让我相信我的要求并不是很清楚,所以我会尝试再次解释。 > > > 通常情况下是这样的: > > > ``` > > > $ curl https://api.example.com/health_check.php > > > pass% > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 但是,如果有人在网络服务器上进行了某些操作,那么健康检查就会返回以下内容: > > > ``` > > > $ curl https://api.example.com/health_check.php > > > <?php > > > echo 'p', 'a', 's', 's'; > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 我希望负载均衡器使后端失败,因为这意味着其他 php 文件的代码可能会直接提供,而不是解释的内容。 > > > > > > 我可以理解为您想要禁用一些特殊的请求标头吗?例如,Content-Type:text/html;字符集=utf-8 > > 不,这不是我想要的。 > > 让我们假设这种情况:我有一些服务器被配置为 apisix 上游对象中的节点;这些服务器正在运行 apache 和 php,并且有人(错误地)在 apache 配置中进行了一些更新,这导致它们不再解释 php 代码,而是直接显示代码;`application/x-httpd-php php php5`例如,如果有人从配置中删除,则可能会发生这种情况。 如果发生这种情况, 的内容`https://api.example.com/healthcheck.php`将不再是`pass`,而是显示`<?php echo 'p', 'a', 's', 's';`。 > > 如果我可以在 apisix 中配置主动 http 检查来查找某个字符串(即`pass`),它会检测到服务器不再通过 healthcheck 并将其从节点池中删除。 OK, I see. Thanks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
