Elastic search error while adding http.cors.allow-origin : "*" in elasticsearch.yml(5.3.3)

After adding
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

these lines in elasticsearch.yml

on restart elasticsearch is throwing below error .

Caused by: while scanning a simple key
in 'reader', line 59, column 1:
http.cors.enabled : true
^
could not find expected ':'
in 'reader', line 60, column 1:
http.cors.allow-origin : "*"

Are you sure that you have an ascii colon : there (Hex char 3a) ?

You would get the error you are seeing if you had a non-ascii colon (e.g. Unicode Full width colon , character xff1a).

1 Like
  • http.cors.enabled: true the "http.cors.enabled" end not have space..
  • http.cors.allow-origin: "*"
1 Like

Yeah worked like charm Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.