Can't connect to ES server
haizaar opened this issue · 3 comments
haizaar commented
Hi guys,
I'm using hosted version of Mirage: http://opensource.appbase.io/mirage/ on Chrome 53.
It can't connect to my dev server that does not have any auth and has CORS allow origin set to *
:
Browser console says the following:
XMLHttpRequest cannot load http://example:9200/foobar/_mapping/. Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.
However my CORES response welcomes everybody:
Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Headers:Content-Length
Access-Control-Allow-Headers:X-Requested-With
Access-Control-Allow-Methods:DELETE
Access-Control-Allow-Methods:POST
Access-Control-Allow-Methods:GET
Access-Control-Allow-Methods:PUT
Access-Control-Allow-Methods:HEAD
Access-Control-Allow-Methods:OPTIONS
Access-Control-Allow-Origin:*
Access-Control-Max-Age:1728000
Connection:keep-alive
Content-Length:0
Date:Tue, 06 Dec 2016 11:29:05 GMT
haizaar commented
Probably related: appbaseio/dejavu#47
farhan687 commented
Hey @haizaar Can you make sure you followed following steps: https://github.com/appbaseio/mirage#install-as-elasticsearch-plugin
and try http.cors.allow-origin: "/.*/"
instead of just *
haizaar commented
Turns out I've missed allow-headers
directive. Now it works wonders. Thank you!