naw
naw

Reputation: 49

With 2.4 ES head plugin not able to connect to external ES server

Getting error of 'Access-Control-Allow-Origin' header is present on the requested resource'

Upvotes: 0

Views: 75

Answers (1)

Val
Val

Reputation: 217564

You need to enable cors in your elasticsearch.yml configuration:

http.cors.enabled: true

Also you need to allow some origin because none is allowed by default:

http.cors.allow-origin: "*"

Note that allowing all origins (i.e. "*") is a security risk, so you can also be more restrictive on that

http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/

Upvotes: 0

Related Questions