I setup a standalone elasticsearch using docker image(elasticsearch:alpine)
Try to enable cors setting in /usr/share/elasticsearch/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization"
then restart this container.
curl --head http://localhost:9200, the result is
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 327
No CORS header, is it right?