1

I'm trying to use Kibana on a server A to access elasticsearch on a server B.
elasticsearch is protected with a basic auth authentication on server B.

Kibana is also protected with basic authentication (and the same password) on server A.

I'm using this configuration (inspired from here)

I'm just trying the redirection by typing the following address and I get a error 500:

In the log I have:

2014/06/01 16:45:55 [error] 3721#0: *1 rewrite or internal redirection cycle while internally redirecting to "/es/_search", client: 192.168.50.1, server: A.com, request: "GET /es/_search HTTP/1.1", host: "A.com"

Any idea what could be wrong ?

Vasili Syrakis
  • 4,558
  • 3
  • 22
  • 30
Hugo Lassiège
  • 113
  • 1
  • 3
  • Please edit your question and include the configs. – EEAA Jun 01 '14 at 20:08
  • why so many rewrites are needed? have you tried default kibana config? https://github.com/elasticsearch/kibana/blob/master/sample/nginx.conf – ADM Jun 01 '14 at 20:10
  • I've read this settings but at first I thought it was not correct for my use case. But I've tried just now and it works. Thanks :) – Hugo Lassiège Jun 02 '14 at 17:39

1 Answers1

1
#
# Nginx proxy for Elasticsearch + Kibana
#
# In this setup, we are password protecting the saving of dashboards. You may
# wish to extend the password protection to all paths.
#
# Even though these paths are being called as the result of an ajax request, the
# browser will prompt for a username/password on the first request
#
# If you use this, you'll want to point config.js at http://FQDN:80/ instead of
# http://FQDN:9200
#
server {
  listen                *:80 ;

  server_name           kibana.myhost.org;
  access_log            /var/log/nginx/kibana.myhost.org.access.log;

  location / {
    root  /usr/share/kibana3;
    index  index.html  index.htm;
  }

  location ~ ^/_aliases$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
  }
  location ~ ^/.*/_aliases$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
  }
  location ~ ^/_nodes$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
  }
  location ~ ^/.*/_search$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
  }
  location ~ ^/.*/_mapping {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
  }

  # Password protected end points
  location ~ ^/kibana-int/dashboard/.*$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
    limit_except GET {
      proxy_pass http://127.0.0.1:9200;
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd;
    }
  }
  location ~ ^/kibana-int/temp.*$ {
    proxy_pass http://127.0.0.1:9200;
    proxy_read_timeout 90;
    limit_except GET {
      proxy_pass http://127.0.0.1:9200;
      auth_basic "Restricted";
      auth_basic_user_file /etc/nginx/conf.d/kibana.myhost.org.htpasswd;
    }
  }
}
ADM
  • 1,373
  • 12
  • 16