0
我们试图隐藏码头后面的kibana服务器并将其用作反向代理。
发生了什么是我们做的是从kibana获取索引html文件,但是当页面试图检索它的图像和CSS失败,404。 我们看到的是,我们试图得到我们去的索引html :http://localhost:8181/sdc1/kibanaProxy使用码头作为kibana的反向代理
然而whne页面改掉访问它去的CSS:
http://localhost:8181/sdc1/styles/main.css?_b=7616
这是在码头代理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);
}
现在我知道kibana可以在使用nginx的代理之后工作。 我在想什么?