关于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
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。