Reputation: 49
Getting error of 'Access-Control-Allow-Origin' header is present on the requested resource'
Upvotes: 0
Views: 75
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