Hello there,
I'm getting a failure for an Options pre-flight request:
XMLHttpRequest cannot load https://tangotelecom.com:5601/app/kibana#/dashboard/irldf_System_Dashboard?…now-1d,mode:absolute,to:now))&_a=(filters:!(),title:irldf_System_Dashboard).
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://tangotelecom.com' is therefore not allowed access. The response had HTTP status code 404
My CORS configuration in elasticsearch.yml is:
http.cors.enabled: true
http.cors.allow-origin: "/.*/"
http.cors.allow-credentials: true
http.cors.allow-headers: "X-Requested-With,Content-Type,Content-Length,Authorization,x-proxy-user"
I'm logging into https://tangotelecom.com/. Then I navigate to page that is making an ajax request to kibana:
var xhr = new XMLHttpRequest();
xhr.open('GET', tempUrl);
xhr.onreadystatechange = iFrameHandler;
xhr.responseType = 'blob';
xhr.setRequestHeader('x-proxy-user', 'irldf');
xhr.setRequestHeader('Authorization', 'Basic ' + btoa('admin'+':'+'tmp12345'));
xhr.withCredentials = true;
xhr.send();
The reason I'm setting the 'x-proxy-user' and 'Authorization' headers is that they are going to be used by a X-Pack custom realm plugin later for authentication purposes. From chrome network tab my Option request and response headers is as follows:
I'm using version 5.1.2 of elastic-search, kibana and x-pack. My kibana configuration (kibana.yml) is bound to
server.port: 5601
server.host: "tangotelecom.com"
From the kibana logs a request looks as follows:
{"type":"response","@timestamp":"2017-04-17T11:18:09Z","tags":,"pid":117443,"method":"options","statusCode":404,"req":{"url":"/app/kibana","method":"options","headers":{"host":"tangotelecom.com:5601","connection":"keep-alive","pragma":"no-cache","cache-control":"no-cache","access-control-request-method":"GET","origin":"https://tangotelecom.com","user-agent":"Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36","access-control-request-headers":"authorization, x-proxy-user","accept":"/","referer":"https://tangotelecom.com/rteDetails.html","accept-encoding":"gzip, deflate, sdch, br","accept-language":"en-US,en;q=0.8,en-GB;q=0.6"},"remoteAddress":"192.168.25.188","userAgent":"192.168.25.188","referer":"https://tangotelecom.com/rteDetails.html"},"res":{"statusCode":404,"responseTime":26,"contentLength":9},"message":"OPTIONS /app/kibana 404 26ms - 9.0B"}
Any advise or guidance on how to trouble-shoot this further? Any help would be much appreciated. Thanks.