Reverse proxy kibana in node express?

I'm simply trying to reverse proxy kibana through a node express app.

I'm using /kibana/ as the route to get to kibana.

It's hanging on the post to elastcisearch/_mget

Any help is appreciated!

Here's the proxy code. I even separated the get and post just to see what's going on.

var httpProxy = require('http-proxy');

var proxyget = httpProxy.createProxyServer({target:'http://192.168.99.100:5601'});
var proxypost = httpProxy.createProxyServer({target:'http://192.168.99.100:5601'});


app.get('/kibana/*', function(req, res) {
  console.log(req.method + ' : ' + req.url);
  req.url = req.url.replace('/kibana','');
  proxyget.web(req, res, { target: 'http://192.168.99.100:5601'});
});

app.post('/kibana/*', function(req, res) {
  console.log(req.method + ' : ' + req.url);
  req.url = req.url.replace('/kibana','');
  proxypost.web(req, res, { target: 'http://192.168.99.100:5601'});
});

And the call that is timing out is:

POST : /kibana/elasticsearch/_mget?timeout=0&ignore_unavailable=true&preference=1446038576531

For me the same thing happened when in Apache config POST was not allowed.Please check if you need to allow POST request explicitly in your config.

Looks like it's a bug that will be fixed in Kibana 4.2.1: https://github.com/elastic/kibana/issues/5230