We are running Kibana 6.7.1 with XPACK on a VM in Azure. The VM is sitting behind an Azure Web Application Firewall (WAF). We have the WAF configured for path based routing where Kibana is accessed via https://app.mydomain.com/kibana. We also have a rewrite rule configured on the App Gateway that rewrites the Location response header from Kibana to be /kibana/{resp_http_Location}. The problem we are seeing is that Kibana keeps looping until the App Gateway shuts down the connection.
From Chrome, when we go to https://app.mydomain.com/kibana, based on our rewrite rule, the Location response header we get is /kibana/login?next=%2F. The browser then send the request to https://app.mydomain.com/kibana/login?next=%2F which Kibana responds back with a Location header value of /kibana/login?next=%2F%2Flogin%3Fnext%3D%252F. The browser then sends a request to https://app.mydomain.com/kibana/login?next=%2F%2Flogin%3Fnext%3D%2F and Kibana responds back with a Location header value of /kibana/login?next=%2F%2Flogin%3Fnext%3D%252F%252Flogin%253Fnext%253D%25252F. This goes back and forth until the App Gateway shuts down the connection.
Not sure what is causing this. Any ideas we can investigate?