fangli / kibana-authentication-proxy

Hosts the latest kibana3 and elasticsearch behind Google OAuth2, Basic Authentication or CAS Authentication
MIT License
223 stars 66 forks source link

Allow serving kibana with prefix #44

Closed hexylena closed 8 years ago

hexylena commented 9 years ago

I'm not able to get separate hostnames for things easily, so we run everything under different /subdirectory/ type routes. The proxy should be able to have a configurable URL prefix that can be used by upstream.

With a proxy prefix in apache that looks like:

  ProxyPass /kibana/ http://localhost:9201/
  <Location /kibana/>
    ProxyPassReverse http://localhost:9201/
  </Location>

The only change in the kibana proxy that was needed was:

diff --git a/app.js b/app.js
index ebfe334..6e477fd 100644
--- a/app.js
+++ b/app.js
@@ -78,7 +78,7 @@ function kibana3configjs(req, res) {

   res.setHeader('Content-Type', 'application/javascript');
   res.end("define(['settings'], " +
-    "function (Settings) {'use strict'; return new Settings({elasticsearch: '/__es', default_route     : '/dashboard/file/default.json'," +
+    "function (Settings) {'use strict'; return new Settings({elasticsearch: '/kibana/__es', default_route     : '/dashboard/file/default.json'," +
       "kibana_index: '" +
       getKibanaIndex() +
       "', panel_names: ['histogram', 'map', 'pie', 'table', 'filtering', 'timepicker', 'text', 'hits', 'column', 'trends', 'bettermap', 'query', 'terms', 'sparklines'] }); });");

Should be trivial to implement.

hexylena commented 8 years ago

Closed so it's no longer on my gigantic list of open PRs/issues since this project seems dead.