Kibana 5.0 apache 代理和反向代理配置失败

Kibana 5.0 apache proxy and reverse-proxy configuration fails

我正在尝试设置一个基本的反向代理来访问我的 kibana 实例。 这里是 kibana 实例(直接通过 :5601 工作没有任何问题)

#server.basePath: ""
server.basePath:"/kibana"

还有我的 apache 东西

<VirtualHost *:80>
    Servername xxxx
    ProxyPreserveHost On
    ProxyRequests On
    ProxyPass / http://localhost:5601
    ProxyPassReverse / http://localhost:5601
</VirtualHost>

问题是我明白了 http://xxxx/

Proxy Error

The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /app/kibana.

Reason: DNS lookup failure for: localhost:5601app

我做了一些测试,但似乎没有任何效果。 第二次尝试 代理通行证 / http://localhost:5601/app/kibana ProxyPassReverse / http://localhost:5601/app/kibana

这次好多了,但还是不行 http://xxxx 我在可以看到 'kibana is loading' 的地方眨了眨眼,紧接着是一条大红色消息

Kibana did not load properly. Check the server output for more information.

好的,这很简单... apache conf 是(注意斜杠)

<VirtualHost *:80>
    Servername xxxx
    ProxyPreserveHost On
    ProxyRequests On
    ProxyPass / http://localhost:5601/
    ProxyPassReverse / http://localhost:5601/
</VirtualHost>

并且我在 Kibana 上默认让所有(没有 base.path)

尝试这样的事情

<VirtualHost *:8190>
    Servername kibana

    DirectoryIndex /app/kibana

    ProxyPass /app/kibana http://kibana:5601/app/kibana
    ProxyPassReverse /app/kibana http://kibana:5601/app/kibana

    ProxyPass /app/timelion http://kibana:5601/app/timelion
    ProxyPassReverse /app/timelion http://kibana:5601/app/timelion

    ProxyPass /bundles http://kibana:5601/bundles
    ProxyPassReverse /bundles http://kibana:5601/bundles

    ProxyPass /elasticsearch http://kibana:5601/elasticsearch
    ProxyPassReverse /elasticsearch http://kibana:5601/elasticsearch

    ProxyPass /status http://kibana:5601/status
    ProxyPassReverse /status http://kibana:/status

    ProxyPass /api/status http://kibana:5601/api/status
    ProxyPassReverse /api/status http://kibana:5601/api/status

    ProxyPass /api/console http://kibana:5601/api/console
    ProxyPassReverse /api/console http://kibana:5601/api/console

    ProxyPass /api/timelion/run http://kibana:5601/api/timelion/run
    ProxyPassReverse /api/timelion/run http://kibana:5601/api/timelion/run

    ProxyPass /api/timelion/functions http://kibana:5601/api/timelion/functions
    ProxyPassReverse /api/timelion/functions http://kibana:5601/api/timelion/functions

    ProxyPass /api/ http://kibana:5601/api/
    ProxyPassReverse /api/ http://kibana:5601/api/

    ProxyPass /goto/ http://kibana:5601/goto/
    ProxyPassReverse /goto/ http://kibana:5601/goto/

    ProxyPass /shorten http://kibana:5601/shorten
    ProxyPassReverse /shorten http://kibana:5601/shorten

    ProxyPass /plugins/kibana/ http://kibana:5601/plugins/kibana/
    ProxyPassReverse /plugins/kibana/ http://kibana:5601/plugins/kibana/

    ProxyPass /plugins/timelion/ http://kibana:5601/plugins/timelion/
    ProxyPassReverse /plugins/timelion/ http://kibana:5601/plugins/timelion/

    ProxyPass /app/sense http://kibana:5601/app/sense
    ProxyPassReverse /app/sense http://kibana:5601/app/sense

    ProxyPass /ui/fonts/open_sans/ http://kibana:5601/ui/fonts/open_sans/
    ProxyPassReverse /ui/fonts/open_sans/ http://kibana:5601/ui/fonts/open_sans/

    ProxyPass /es_admin/ http://kibana:5601/es_admin/
    ProxyPassReverse /es_admin/ http://kibana:5601/es_admin/

    ErrorLog "logs/kibana-error.log"

</VirtualHost>

Kibana 4 不到一半:)

我在 Apache/2.4.10:

上使用这个更紧凑的虚拟主机配置
<Location "/">
    Require all granted

    ProxyPass "http://127.0.0.1:5601/" keepalive=On
    ProxyPassReverse "http://127.0.0.1:5601/"
    #LogLevel alert trace5
</Location>

在 Kibana 6.5.4 上,Sergiu Indrie 的回答版本略有不同(感谢您的回答)。对我来说,没有插件部分是行不通的。

    ProxyRequests On

    ProxyPass /KIB/app/kibana http://127.0.0.1:5601/app/kibana
    ProxyPassReverse /KIB/app/kibana http://127.0.0.1:5601/app/kibana

    ProxyPass /KIB/app/timelion http://127.0.0.1:5601/app/timelion
    ProxyPassReverse /KIB/app/timelion http://127.0.0.1:5601/app/timelion
    ProxyPass /KIB/bundles http://127.0.0.1:5601/bundles
    ProxyPassReverse /KIB/bundles http://127.0.0.1:5601/bundles
    ProxyPass /KIB/plugins http://127.0.0.1:5601/plugins
    ProxyPassReverse /KIB/plugins http://127.0.0.1:5601/plugins
    ProxyPass /KIB/elasticsearch http://127.0.0.1:5601/elasticsearch
    ProxyPassReverse /KIB/elasticsearch http://127.0.0.1:5601/elasticsearch
    ProxyPass /KIB/status http://127.0.0.1:5601/status
    ProxyPassReverse /KIB/status http://127.0.0.1:5601/status
    ProxyPass /KIB/api http://127.0.0.1:5601/api
    ProxyPassReverse /KIB/api http://127.0.0.1:5601/api
    ProxyPass /KIB/goto http://127.0.0.1:5601/goto
    ProxyPassReverse /KIB/goto http://127.0.0.1:5601/goto
    ProxyPass /KIB/shorten http://127.0.0.1:5601/shorten
    ProxyPassReverse /KIB/shorten http://127.0.0.1:5601/shorten

    <Directory /KIB/app/kibana/>
        Require all granted
    </Directory>

nano /etc/apache2/sites-available/kibana-vhost.conf

<VirtualHost *:80>
    Servername xxxx.name.xyz
    ProxyPreserveHost On
    ProxyRequests On
    ProxyPass / http://localhost:5601/
    ProxyPassReverse /(.*) http://localhost:5601/(.*)
</VirtualHost>

谢谢,

这对我有用...