浏览器控制台报错:
Access to XMLHttpRequest at 'http://localhost:9200/_cluster/health' from origin 'http://localhost:9100' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.
更改ES配置文件elasticsearch.yml
# 添加
http.cors.enabled: true
http.cors.allow-origin: /.*/
参考文档:
https://blog.csdn.net/qq_27559331/article/details/88076761
https://blog.csdn.net/shiyaru1314/article/details/71557228