0
点赞
收藏
分享

微信扫一扫

【ElasticSearch】关于es跨域的问题


本文目录

一、使用es的head插件

二、其他说明

一、使用es的head插件

在使用es的head插件时,默认的9100,需要访问es的默认端口9200时,会出现跨域问题,此时只需要修改一下es的配置文件即可。

elasticsearch.yml中添加开启跨域的配置:

http.cors.enabled: true
http.cors.allow-origin: "*"

说明:

http.cors.enabled 是否开启跨域

http.cors.allow-origin 允许谁访问,* 号是通配符

二、其他说明

如果在使用 elasticsearch-head 还是存在跨域的问题,则可以在elasticsearch.yml配置文件继续追加配置

http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
http.cors.allow-headers: Content-Type,Accept,Authorization,x-requested-with

完结!

举报

相关推荐

0 条评论