polaru commented on issue #10517:
URL: https://github.com/apache/apisix/issues/10517#issuecomment-1822324637

   > > My upstream is a php webserver and it doesn't execute arbitrary code. 
But your question makes me believe it wasn't very clear what I was asking for, 
so I'll try to explain it again.
   > > Normally this is what it looks like:
   > > ```
   > > $ curl https://api.example.com/health_check.php
   > > pass%    
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > But if somebody does fatfinger something on the webserver and this is 
what the healthcheck returns instead:
   > > ```
   > > $ curl https://api.example.com/health_check.php
   > > <?php
   > > echo 'p', 'a', 's', 's';
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > I want the loadbalancer to fail the backend because it means it's likely 
the code of other php files might be served directly, instead of the 
interpreted content.
   > 
   > Can I understand that you want to disable some special request headers? 
For example, Content-Type: text/html; charset=utf-8
   
   No, this is not what I want. 
   
   Let's assume this scenario: I have some servers that are configured as nodes 
in an apisix upstream object; those servers are running apache and php and 
somebody does (by mistake) some update in the apache configuration and it 
causes them to no longer interpret the php code, but instead show the code 
directly; this could happen if somebody removed `application/x-httpd-php        
php php5` from the configuration for example.
   If this happens, the content of `https://api.example.com/healthcheck.php` 
would no longer be `pass`, but instead it would show ```<?php
   echo 'p', 'a', 's', 's';```. 
   
   If I could configure the active http check in apisix to also look for a 
certain string (i.e. `pass`), it would have detected the server as no longer 
passing the healtcheck and remove it from the pool of nodes.


-- 
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]

Reply via email to