elasticsearch.yml
http.host: 0.0.0.0
# Uncomment the following lines for a production cluster deployment
transport.host: 0.0.0.0
#discovery.zen.minimum_master_nodes: 1
# 加入跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
要这样配置
elasticsearch.yml
http.host: 0.0.0.0
# Uncomment the following lines for a production cluster deployment
transport.host: 0.0.0.0
#discovery.zen.minimum_master_nodes: 1
# 加入跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
要这样配置