繁体   English   中英

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

[英]Kibana 5.0 apache proxy and reverse-proxy configuration fails

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

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

还有我的阿帕奇东西

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

问题是我得到了http:// xxxx /

代理错误

代理服务器从上游服务器收到无效响应。 代理服务器无法处理GET / app / kibana请求。

原因:DNS查找失败:本地主机:5601app

我做了一些测试,但似乎无济于事。 第二次尝试使用ProxyPass / http:// localhost:5601 / app / kibana ProxyPassReverse / http:// localhost:5601 / app / kibana

这次比较好了,但还是不行http:// xxxx我眨了眨眼,在那儿看到“ kibana正在加载”,并且在出现一条红色大消息后

Kibana没有正确加载。 检查服务器输出以获取更多信息。

好吧,那很容易... 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不到一半:)

在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>

我在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>

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>

谢谢,

这项工作对我来说...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM