简体   繁体   中英

Apache reverse proxy for Kibana

I'm currently trying to set up an Apache server to redirect eg localhost/kibana to Kibana at localhost:5601.

I've tried adding this to apache2.conf:

ProxyPass /kibana http://localhost:5601
ProxyPassReverse /kibana http://localhost:5601

However it gets stuck on the Kibana "loading components" page and never actually loads fully. It works when changed to this:

ProxyPass /kibana/ http://localhost:5601/
ProxyPassReverse /kibana/ http://localhost:5601/

Obviously it's not ideal to force the user to enter the extra / at the end though, so I've tried rewriting the URL in .htaccess:

RewriteEngine On
RewriteRule http://localhost/kibana$ http://localhost/kibana/

But the rewrite doesn't seem to work. I've set AllowOverride to all and enabled the rewrite module, as well as played around with various different rewrite/proxy rules but haven't had any luck so far.

I have finished my apache configuration file for kibana with elasticsearch. It may be useful for you:

/etc/httpd/conf.d/kibana.conf:

ProxyRequests On

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

ProxyPass /elasticsearch http://127.0.0.1:9200/
ProxyPassReverse /elasticsearch http://127.0.0.1:9200/

Alias /bundles/ /opt/kibana/optimize/bundles/

<Directory /opt/kibana>
    Require all granted
</Directory>

This way it does not require any additional "/" and it works with default kibana configuration file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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