elasticsearch - nginx CORS policy: No 'Access-Control-Allow-Origin error

#error message
Access to XMLHttpRequest at 'http://192.168.0.102:9200/' from origin 'http://192.168.0.102' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 

#solution
[root@elkmaster ~]# vi /etc/elasticsearch/elasticsearch.yml
[#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
network.host: 0.0.0.0
network.bind_host: 0.0.0.0
transport.host: 127.0.0.1
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"

댓글

이 블로그의 인기 게시물

error You have $NVM_DIR set to "/root/.nvm", but that directory does not exist. Check your profile files and environment.

linux mint install xrdp

centos 6.x yum update problem making ssl connection