Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kibana 3 and Elasticsearch 1.4 - CORS problem

Kibana 3 against ElasticSearch 1.4 throws an Connection Failed screen. The error text says to set http.cors.allow-origin, but it misses out the important http.cors.enabled: true

Working config:

$ grep cors elasticsearch-1.4.0.Beta1/config/elasticsearch.yml
http.cors.allow-origin: "/.*/"
http.cors.enabled: true
@PeterGrace

This comment has been minimized.

Show comment
Hide comment
@PeterGrace

PeterGrace Oct 28, 2014

Thank you! I found this gist when googling for this exact issue. Enabling cors also resolved my problem.

PeterGrace commented Oct 28, 2014

Thank you! I found this gist when googling for this exact issue. Enabling cors also resolved my problem.

@thinkspill

This comment has been minimized.

Show comment
Hide comment
@thinkspill

thinkspill Nov 13, 2014

This is pretty critical information that should at least be mentioned in the 1.4 changelog......

thinkspill commented Nov 13, 2014

This is pretty critical information that should at least be mentioned in the 1.4 changelog......

@sT331h0rs3

This comment has been minimized.

Show comment
Hide comment
@sT331h0rs3

sT331h0rs3 Nov 14, 2014

Thanks a lot!

sT331h0rs3 commented Nov 14, 2014

Thanks a lot!

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 24, 2014

I have kibana faced by nginx (we need nginx for basic auth) on different host then elasticsearch and this workaround did`t resolve the problem. It only resolves the problem when kibana and ES on the same host.

ghost commented Nov 24, 2014

I have kibana faced by nginx (we need nginx for basic auth) on different host then elasticsearch and this workaround did`t resolve the problem. It only resolves the problem when kibana and ES on the same host.

@subzero112233

This comment has been minimized.

Show comment
Hide comment
@subzero112233

subzero112233 Dec 16, 2014

hey guys,
I'm ruinning kibana and elasticsearch on the same servers, tried adding:
http.cors.allow-origin: "/.*/"
http.cors.enabled: true

but it still won't work.

any ideas?

EDIT:
I suggest everyone who's facing this problem reads "https://www.digitalocean.com/community/tutorials/how-to-use-logstash-and-kibana-to-centralize-and-visualize-logs-on-ubuntu-14-04"
though it's a little out-dated in terms of elasticsearch version, it made me understand what I did wrong (elasticsearch configuration).

subzero112233 commented Dec 16, 2014

hey guys,
I'm ruinning kibana and elasticsearch on the same servers, tried adding:
http.cors.allow-origin: "/.*/"
http.cors.enabled: true

but it still won't work.

any ideas?

EDIT:
I suggest everyone who's facing this problem reads "https://www.digitalocean.com/community/tutorials/how-to-use-logstash-and-kibana-to-centralize-and-visualize-logs-on-ubuntu-14-04"
though it's a little out-dated in terms of elasticsearch version, it made me understand what I did wrong (elasticsearch configuration).

@SamyaMaiti2012

This comment has been minimized.

Show comment
Hide comment
@SamyaMaiti2012

SamyaMaiti2012 Dec 16, 2014

looks like I am also doing the same mistake. Can you tell me how you resolved.

SamyaMaiti2012 commented Dec 16, 2014

looks like I am also doing the same mistake. Can you tell me how you resolved.

@aseev-xx

This comment has been minimized.

Show comment
Hide comment
@aseev-xx

aseev-xx Dec 19, 2014

Thanks a lot!

aseev-xx commented Dec 19, 2014

Thanks a lot!

@cta101

This comment has been minimized.

Show comment
Hide comment
@cta101

cta101 Jan 3, 2015

After you added the cors settings in elasticsearch config don't reload the kibana page but click back or home button as the webpage says.
If you click refresh you just reload the same "kibana/index.html#/connectionFailed" error page.

cta101 commented Jan 3, 2015

After you added the cors settings in elasticsearch config don't reload the kibana page but click back or home button as the webpage says.
If you click refresh you just reload the same "kibana/index.html#/connectionFailed" error page.

@naisanza

This comment has been minimized.

Show comment
Hide comment
@naisanza

naisanza Jan 5, 2015

I just ran into this problem last night. And it's also good to know one other thing

This didn't work:
http.cors.allow-origin: *

But this did:
http.cors.allow-origin: "*"

Be sure to have "http.cors.enabled: true" included in your .yml file as well.

naisanza commented Jan 5, 2015

I just ran into this problem last night. And it's also good to know one other thing

This didn't work:
http.cors.allow-origin: *

But this did:
http.cors.allow-origin: "*"

Be sure to have "http.cors.enabled: true" included in your .yml file as well.

@100star

This comment has been minimized.

Show comment
Hide comment
@100star

100star Feb 4, 2015

Thanks a lot, it work :)

100star commented Feb 4, 2015

Thanks a lot, it work :)

@hmorgado

This comment has been minimized.

Show comment
Hide comment
@hmorgado

hmorgado Mar 30, 2015

yeah, it worked for me! thanks =)

hmorgado commented Mar 30, 2015

yeah, it worked for me! thanks =)

@akaluzinski

This comment has been minimized.

Show comment
Hide comment
@akaluzinski

akaluzinski Apr 10, 2015

Thank you! It's very useful solution!

akaluzinski commented Apr 10, 2015

Thank you! It's very useful solution!

@isanjaykp

This comment has been minimized.

Show comment
Hide comment
@isanjaykp

isanjaykp May 13, 2015

Hmm... Worked for me.

isanjaykp commented May 13, 2015

Hmm... Worked for me.

@khoan

This comment has been minimized.

Show comment
Hide comment
@khoan

khoan Jul 22, 2015

not working for ES 1.6 on AWS

khoan commented Jul 22, 2015

not working for ES 1.6 on AWS

@russray2008

This comment has been minimized.

Show comment
Hide comment
@russray2008

russray2008 Aug 14, 2015

Thank you very much for your suggestion. This helped me fixed my issue.

russray2008 commented Aug 14, 2015

Thank you very much for your suggestion. This helped me fixed my issue.

@nsteblay

This comment has been minimized.

Show comment
Hide comment
@nsteblay

nsteblay Jan 29, 2016

Yes. For OS X El Capitan 10 using Chrome browser.
Adding the two lines to /usr/local/etc/elasticsearch/elasticsearch.yml
http.cors.allow-origin: "*"
http.cors.enabled: true
resolved the issue.

nsteblay commented Jan 29, 2016

Yes. For OS X El Capitan 10 using Chrome browser.
Adding the two lines to /usr/local/etc/elasticsearch/elasticsearch.yml
http.cors.allow-origin: "*"
http.cors.enabled: true
resolved the issue.

@sirLoaf

This comment has been minimized.

Show comment
Hide comment
@sirLoaf

sirLoaf Mar 25, 2016

thx. worked for me

sirLoaf commented Mar 25, 2016

thx. worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment