Funny enough (or frustrating enough), an http-ecv monitor won’t work with JSON-based replies on a Citrix ADC / NetScaler. It will not find any data in an HTTP response and fail. WTF?
The http-ecv monitor requires the http-response to be of MIME-Type text (usually text/html). JSON data, however, is application/json. That’s why it does not work.
There is nothing like a solution. It works (or doesn’t work) as designed. Citrix product development would be able to solve the problem for us. I guess it’s just one or two lines of code, it would be great if they did. If you know somebody, push him in that direction!
First things first: A workaround is no solution, a dirty workaround is even worse. This is a dirty one, but the only one I know, and it works.
We need to create an lb-vServer for every service we have. Next, we have to rewrite the HTTP-response header
content-type to text/html using a rewrite policy. Last, we have to create a monitor, pointing to this vServer, instead of pointing to the Real Server.