Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running elasticsearch under a subdirectory #19

Open
psaiz opened this issue Dec 8, 2016 · 0 comments
Open

Running elasticsearch under a subdirectory #19

psaiz opened this issue Dec 8, 2016 · 0 comments

Comments

@psaiz
Copy link

psaiz commented Dec 8, 2016

First of all, thanks for the very useful plugin!

I have an issue running the plugin on my cluster. I'm using the same port for kibana and elastic, and then, based on the location, I go to kibana or elastic. In other words, under my web server I have
https://my.host.domain/elastic and https://my.host.domain/kibana .

So, to reach whatson, I go to https://my.host.domain/elastic/_plugin/whatson. Then, the plugin leaves the 'elasticsearch host' box in the settings empty. If I put there https://my.host.domain/elastic, then the javascript appends :9200.

Would it be possible to have a patch like the following:


diff --git a/_site/assets/js/app.js b/_site/assets/js/app.js
index 1931c33..53701d8 100644
--- a/_site/assets/js/app.js
+++ b/_site/assets/js/app.js
@@ -21,13 +21,8 @@
                        var self = this;
 
                        // Set default configs
-                       if ( '/_plugin/whatson' == window.location.pathname.substr(0,16) ) {
-                               // Running as ES site plugin
-                               self._info.host = window.location.protocol + '//' + window.location.host;
-                       } else {
-                               // Running elsewhere
-                               self._info.host = '';
-                       }
+                       self._info.host = window.location.protocol + '//' + window.location.host + window.location.pathname.replace('/_plugin/whatson', '');
+
                        $( '#navbar-clusterconfig-host' ).val( self._info.host );
                        self._refresh_interval = 5000;
                        $( '#navbar-clusterconfig-refresh' ).val( self._refresh_interval / 1000 );
@@ -65,8 +60,6 @@
                                        host = host.replace(/\/$/g, "");
                                        if ( null == host.match(/^https?:\/\//) )
                                                host = 'http://' + host;
-                                       if ( null == host.match(/:[0-9]*$/) )
-                                               host += ':9200';
 
                                        $( '#navbar-clusterconfig-host' ).val( host );

Thanks a lot,
pablo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant