elasticsearch-whatson icon indicating copy to clipboard operation
elasticsearch-whatson copied to clipboard

using whatson behind a load balancing proxy fails

Open epackorigan opened this issue 9 years ago • 4 comments

whatson running behind a load balancer shared with a kibana instance doesn't appear to work properly.

whatson is installed on all the ES nodes apache load balancer to all the ES nodes for the required path (nodes, cluster, etc), except "/" (that one redirects to the kibana web interface).

could the version be determined by use of _nodes rather than "/" ?

epackorigan avatar Oct 29 '14 17:10 epackorigan

It's been over 8 month since ES 1.x was officially released so it seems like we should just get rid of the versioning stuff. Those still on 0.90.x will just have to use the old version of the plugin.

xyu avatar Oct 30 '14 15:10 xyu

Same issue here

The ES nodes are reverse proxied to http://dns.name/es/, the config in Whatson changes it to http://dns.name/es/:9200

If I define a port like http://dns.name:80/es/ it gets changed to http://dns.name:80/es:9200

elvarb avatar Jan 15 '15 11:01 elvarb

I had the same problem and changed app.js to support my apache reverse-proxy configuration for elasticsearch ... in function init() I replaced line 25

            // Running as ES site plugin
            self._info.host = window.location.protocol + '//' + window.location.host;

with // Running elsewhere - maybe behind reverse-proxying system? var locURL = window.location.pathname; var match = locURL.match(//_plugin/whatson/?$/); if ( ( match != null ) && ( match.length == 1 ) ) { self._info.host = locURL.slice(0,(-1 * match[0].length)); } else { // Running elsewhere self._info.host = ''; }

and commented out the following four lines from line 66 on

                if ( null == host.match(/^https?:\/\//) )
                    host = 'http://' + host;
                if ( null == host.match(/:[0-9]*$/) )
                    host += ':9200';

Now whatson starts with a correct host and accepts unusual host definitions (ok, the convenience of automatic protocol and port addition is missing )...

baloo66 avatar Sep 24 '15 12:09 baloo66

I had the same problem and changed app.js to support my apache reverse-proxy configuration for elasticsearch ... in function init() I replaced line 25

            // Running as ES site plugin
            self._info.host = window.location.protocol + '//' + window.location.host;

with // Running elsewhere - maybe behind reverse-proxying system? var locURL = window.location.pathname; var match = locURL.match(//_plugin/whatson/?$/); if ( ( match != null ) && ( match.length == 1 ) ) { self._info.host = locURL.slice(0,(-1 * match[0].length)); } else { // Running elsewhere self._info.host = ''; }

and commented out the following four lines from line 66 on

                if ( null == host.match(/^https?:\/\//) )
                    host = 'http://' + host;
                if ( null == host.match(/:[0-9]*$/) )
                    host += ':9200';

Now whatson starts with a correct host and accepts unusual host definitions (ok, the convenience of automatic protocol and port addition is missing )...

baloo66 avatar Sep 24 '15 12:09 baloo66