简体   繁体   English

使用码头作为基巴纳的反向代理

[英]using jetty as reverse proxy for kibana

we are try to hide the kibana server behind a jetty and use it as reverse proxy. 我们正在尝试将kibana服务器隐藏在码头后面,并将其用作反向代理。
what happens is that we do mange to get the index html file from kibana but when the page tries to retrieve its images and css it fails with 404. what we see is that wen we try to get the index html we go to: http://localhost:8181/sdc1/kibanaProxy 发生的是,我们确实设法从kibana获取索引html文件,但是当页面尝试检索其图像和CSS时,它失败并显示404。我们看到的是,我们尝试获取索引html,然后转到: http: //本地主机:8181 / sdc1 / kibanaProxy

however whne the page trys to access the css it goes to : 但是,当页面尝试访问CSS时,它会转到:
http://localhost:8181/sdc1/styles/main.css?_b=7616 http:// localhost:8181 / sdc1 / styles / main.css?_b = 7616

this is my proxy function in the jetty proxy servlet: 这是我在码头代理servlet中的代理功能:

public URI rewriteURI(HttpServletRequest request) {
    String requestURI = request.getRequestURI();
    String originalUrl = request.getRequestURL().toString();
    String suffix = requestURI.replace("/sdc1/kibanaProxy", "/");
    String redirectedUrl = new     StringBuilder("http://localhost:5601").append(suffix).toString();
    log.debug("KibanaServlet Redirecting request from: {} , to: {}", originalUrl, redirectedUrl);
    return URI.create(redirectedUrl);
}

now i know that kibana can work behind a proxy using nginx. 现在我知道kibana可以使用nginx在代理后面工作。 what am i missing? 我想念什么?

in the end the root cause was that for kibana to retrieve all the required component( css images etc) we need to change the proxy url to one that ends with / /sdc1/kibanaProxy --> /sdc1/kibanaProxy/ 最后,根本原因是,对于kibana来说,要检索所有必需的组件(css图像等),我们需要将代理URL更改为以/ / sdc1 / kibanaProxy-> / sdc1 / kibanaProxy /

and that solves all the problem. 这样就解决了所有问题。

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

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