更新时间:2023-12-01 20:36:28
嗯,这是一个艰难的一个。
Well, that was a tough one.
下面就是固定它:
,http://enable-cors.org/server_apache.html 在 /等/ apache2的/ httpd.conf文件
,配置访问控制允许来源:
Per http://enable-cors.org/server_apache.html, in /etc/apache2/httpd.conf
, configure Access-Control-Allow-Origin:
<Directory />
# Add the following line to enable CORS to connect to local elasticsearch.
Header set Access-Control-Allow-Origin "localhost:9200"
AllowOverride none
Require all denied
</Directory>
每https://jsbroadcast.com/elastic-search-cors/,在 elasticsearch-1.7.0 /配置/ elasticsearch.yml
补充:
http.cors.enabled : true //
http.cors.allow-origin: "/.*/"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization"
我现在可以运行没有任何错误的 client.ping
电话。