Docker容器ElasticSearch-Head创建索引无响应406

时间:2022-07-23
本文章向大家介绍Docker容器ElasticSearch-Head创建索引无响应406,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

ElasticSearch-Head创建索引无响应,F12查看发现406错误, 修改head的 Content-Type 设置.

docker exex -it 容器id /bin/bash
root@b93fa4e29ba2:/usr/src/app# vim _site/vendor.js
1. 6886行 /contentType: "application/x-www-form-urlencoded 
    改成 contentType: "application/json;charset=UTF-8" 
2. 7574行 var inspectData = s.contentType ==`= "application/x-www-form-urlencoded" &&` 
    改成 var inspectData = s.contentType === "application/json;charset=UTF-8" &&
root@b93fa4e29ba2:/usr/src/app/_site# exit
exit
[root@localhost ~]# docker restart 容器id