Can you share the URLs the Kibana is trying to redirect you to? If you use curl or something it might be easier to see. I'm guessing that you need to add a rewrite to remove /kibana from the url, because even though you've set the basePath to '/kibana' it expects that to be removed before the request is routed to Kibana. In kibana 6.3+ there is a server.rewriteBasePath which you can enable to tell kibana that it should rewrite requests to {basePath}/* internally, but you'd have to upgrade Kibana and Elasticsearch.
My kibana.yml looks like this:
server.basePath: "/kibana"
My goal is to have kibana behind nginx, but when I go to https://foo.biz/kibana, I get a redirect loop to kibana/ and then back to kibana and on and on.
My understanding was the server.basePath was supposed to resolve this?
My understanding is that the server.basePath would append the value assigned to it? Such that the value of the last redirect would be https://foo.biz/kibana/app/kibana.
Am I understanding the value of server.basePath?
Finally I wanted to reach out to @jarpy as he seemed to help with a similar issue 126732.
If you are seeing requests in your Kibana logs, then at least we know that Docker networking is configured correctly. I see that early on you had your Kibana container bound to the loopback interface with server.host, but you have that cleared up now.
I'll leave you with the Kibana experts to hopefully resolve the rewrite dilemma.
Thanks for your advice, it does not appear that I'm seeing requests on the Kibana logs. The logs never change from:
{"type":"log","@timestamp":"2018-11-23T14:14:39Z","tags":["status","plugin:elasticsearch@6.3.1","info"],"pid":1,"state":"green","message":"Status changed from red to green - Ready","prevState":"red","prevMsg":"Unable to connect to Elasticsearch at http://elasticsearch:9200."}
@spalger@jarpy don't mean to bother, please do let me know if I'm being impolite, just curious if there are any ideas or insights or needed info with regard to my issue.
Hey, sorry to keep you waiting. The best thing I could do would be to try and replicate what you are seeing. To be honest, I still need bit more detail.
If you could share exactly how you are starting the containers, and the complete configuration for Kibana (you've posted that, thanks) and Nginx, then maybe I can reproduce it. It's much easier to figure out a problem when you can reproduce it on your own system.
@jarpy@spalger, I have an update. I am getting a 200 from kibana (with the configs shared – sorry for my mistake).
It appears that the path is not getting altered by the kibana.yml. I thought the server.basePath would append the value provided to the path, such that if I request https://foo/kibana, I'd get back, https://foo/kibana/app/kibana/etc, instead if I request https://foo/kibana, I get back https://foo/app/kibana.
Thank you for your patience with my mistakes, again any guidance you can provide, would be greatly appreciated.
This curl is from the nginx host:
# curl http://kibana:5601
<script>var hashRoute = '/app/kibana';
var defaultRoute = '/app/kibana';
var hash = window.location.hash;
if (hash.length) {
window.location = hashRoute + hash;
} else {
window.location = defaultRoute;
}</script>#
Thanks! I always ask people to share everything they can. You never know where problems will show up. In fact, I would say that people tend to share snippets that don't have problems, becuase they share the parts that they are looking at closely and have thus eliminated all the bugs.
I haven't finished my reproduction yet, but I can already see something very suspicious:
ADD kibana.yml /etc/kibana/
Our container image does not look for kibana.yml in /etc/kibana, so your settings won't be having any effect. The correct location is /usr/share/kibana/config/kibana.yml. This is the standard for Elastic products installed from tarballs (not deb or rpm packages), which is how the images are made.
Yes. That did the trick in my repro environment. You'll also want to remove xpack.security.enabled: false from kibana.yml since you are running the OSS-only image which does not recognise that setting. The fact that Kibana starts at all shows that it's not picking up the settings. Kinda funny.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.