Skip to content

Instantly share code, notes, and snippets.

@slavikdev
Created April 21, 2017 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slavikdev/7b9d2989bab10dca1d139664c908b7dd to your computer and use it in GitHub Desktop.
Save slavikdev/7b9d2989bab10dca1d139664c908b7dd to your computer and use it in GitHub Desktop.
When ElasticSearch GET works, but POST and PUT return 403 Forbidden

One of the possibilities is that in your elasticsearch.yml you have CORS enabled and the regex you use to match the origin doesn’t work. For example Chrome extensions add chrome-extension:// to the origin and matching it as /https?:\/\/.+/ won’t work. Instead you may use broader regex:

http.cors.enabled: true
http.cors.allow-origin: /.*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment