Error setting up reverse proxy for Kibana

I try to setup a reverse nginx proxy by following advice on this thread: Auto authenticating to an embedded Kibana dashboard (on Elastic.co CLOUD)

I am using Elastic Cloud for both Kibana.

And got this error
{
error: {
root_cause: [
{
type: "illegal_argument_exception",
reason: "No endpoint or operation is available at [kibana]"
}
],
type: "illegal_argument_exception",
reason: "No endpoint or operation is available at [kibana]"
},
status: 400
}

Here's my nginx configuration.

server {
	listen 443;
	server_name localhost;
	ssl on;
	ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
	ssl_session_cache    shared:SSL:1m;
	ssl_session_timeout 5m;
	ssl_ciphers  HIGH:!aNULL:!MD5;
	ssl_prefer_server_ciphers on;

	location / {
	     proxy_set_header  X-Found-Cluster XXXXXX;
         proxy_set_header  Host $host;
         proxy_set_header  X-Real-IP $remote_addr;
         proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header  Authorization "Basic YYYYYY";
         proxy_pass  https://XXXXXX.eu-west-1.aws.found.io;
     }
}

Any idea?

Hi,

Can you set your endpoint here to Kibana and let us know what is happening?
proxy_pass https://XXXXXX.eu-west-1.aws.found.io;

Thanks,
Bhavya

@bhavyarm proxy_pass is already set to the kibana endpoint specified in Elastic Cloud.

Hi Eric,

Am confused. In your nginx config above your proxy_pass is set to es_cluster.

location / {
     proxy_set_header  X-Found-Cluster XXXXXX;
     proxy_set_header  Host $host;
     proxy_set_header  X-Real-IP $remote_addr;
     proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header  Authorization "Basic YYYYYY";
     **proxy_pass  https://XXXXXX.eu-west-1.aws.found.io;**
 }

}

Can we try setting this to Kibana end point?

Thanks,
Bhavya

It is set to the Kibana end point. I've attached two screenshots. One is the Kibana URL I got from Elastic cloud. The other is my nginx configuration. Proxy_pass is set to exactly the kibana URL in the Elastic Cloud.


Ah.Gotcha. What happens when you add this "/app/kibana" at the end of the endpoint there?
I might also be taking you on a wild goose chase. I have asked the dev team to take a look at this.

Thanks,
Bhavya

@bhavyarm. No worries I really like to get this working.

Updated nginx:
proxy_pass https://27c0xxxxxxxxx.us-west-2.aws.found.io/app/kibana;

Here's the URL given to me from the Kibana to show a dashboard in iframe:
https://27c0xxxxxxxxx.us-west-2.aws.found.io/app/kibana#/dashboard/e2e4b060-2c30-11e7-ac0b-c98d5271b0ae?embed=true&_g=()

Here's the URL I used to get to the same iframe through my Nginx proxy:
https://mycompany-domain.com/app/kibana#/dashboard/e2e4b060-2c30-11e7-ac0b-c98d5271b0ae?embed=true&_g=()

Here's the response the link above:
{
error: {
root_cause: [
{
type: "index_not_found_exception",
reason: "no such index",
resource.type: "index_expression",
resource.id: "app",
index_uuid: "na",
index: "app"
}
],
type: "index_not_found_exception",
reason: "no such index",
resource.type: "index_expression",
resource.id: "app",
index_uuid: "na",
index: "app"
},
status: 404
}

Sorry no progress :slight_smile: Will keep you posted.

Cheers,
Bhavya

Hi Eric,

My apologies for the delay. I couldn't really reproduce this in my local. I will try to get some help and buzz you.

Thanks,
Bhavya

I resolved this myself. Basically the error is the cluster ID entered in the nginx config must be cluster id of Kibana, not Elasticsearch.

Ahhhh...thanks for posting the solution here.

Cheers,
Bhavya