欢迎投稿

今日深度:

关于elasticsearch跨域访问设置,elasticsearch跨域

关于elasticsearch跨域访问设置,elasticsearch跨域


    问题产生:js访问elasticsearch服务端进行数据交互,使用post请求,传入json数据。

一直提示...Origin null is not allowed by Access-Control-Allow-Origin.

   解决方法:

  elasticsearch默认不允许跨域访问,同时也需要设置返回IP的参数。

在config/elasticsearch.yml     后面增加以下参数:

#开启跨域访问支持,默认为false
http.cors.enabled: true
#跨域访问允许的域名地址,
(允许所有域名)以上使用正则
http.cors.allow-origin: /.*/
 






具体参数请查看官网 https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-http.html


www.htsjk.Com true http://www.htsjk.com/Elasticsearch/33157.html NewsArticle 关于elasticsearch跨域访问设置,elasticsearch跨域     问题产生:js访问elasticsearch服务端进行数据交互,使用post请求,传入json数据。 一直提示... Origin null is not allowed by Access-Control-Allow-Or...
相关文章
    暂无相关文章
评论暂时关闭