From b764f41161484d5c12ccbc990a81dbd7dfb8c35d Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Wed, 5 Nov 2014 16:32:52 -0700 Subject: [PATCH] Specify elasticsearch path on frontend. Allow for SSL proxies. Closes #1772 --- src/kibana/components/config/config.js | 6 ++++++ src/kibana/index.js | 1 - src/server/routes/home.rb | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/kibana/components/config/config.js b/src/kibana/components/config/config.js index 8cd53f4bb8c025..d89eec9318c647 100644 --- a/src/kibana/components/config/config.js +++ b/src/kibana/components/config/config.js @@ -4,6 +4,12 @@ define(function (require) { ]); var configFile = JSON.parse(require('text!config')); + configFile.elasticsearch = ( + window.location.protocol + '//' + + window.location.hostname + + (window.location.port ? ':' + window.location.port : '') + + '/elasticsearch/'); + // allow the rest of the app to get the configFile easily module.constant('configFile', configFile); diff --git a/src/kibana/index.js b/src/kibana/index.js index 5d7237587828cb..4c723985f8e844 100644 --- a/src/kibana/index.js +++ b/src/kibana/index.js @@ -26,7 +26,6 @@ define(function (require) { 'ngClipboard' ]); - configFile.elasticsearch = (window.location.protocol + '//' + window.location.hostname + '/elasticsearch/'); kibana // This stores the Kibana revision number, @REV@ is replaced by grunt. diff --git a/src/server/routes/home.rb b/src/server/routes/home.rb index 81fdb9d871556c..df4216bea52e3c 100644 --- a/src/server/routes/home.rb +++ b/src/server/routes/home.rb @@ -12,10 +12,9 @@ class Home < Base # Clone the settings object and change the elasticsearch attribute # to the proxy for elasticsearch data = settings.config.clone() - data['elasticsearch'] = "#{request.scheme}://#{request.host}:#{request.port}/elasticsearch" - plugins = external_plugins.concat(bundled_plugins) data['plugins'] = plugins + data.delete('elasticsearch') json data end