title: using jetty as reverse proxy for kibana
body: <p>we are try to hide the kibana server behind a jetty and use it as reverse proxy.<br>
  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:<a href="http://localhost:8181/sdc1/kibanaProxy" rel="nofollow">http://localhost:8181/sdc1/kibanaProxy</a></p>
  
  <p>however whne the page trys to access the css it goes to :<br>
  <a href="http://localhost:8181/sdc1/styles/main.css?_b=7616" rel="nofollow">http://localhost:8181/sdc1/styles/main.css?_b=7616</a></p>
  
  <p>this is my proxy function in the jetty proxy servlet:</p>
  
  <pre><code>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);
  }
  </code></pre>
  
  <p>now i know that kibana can work behind a proxy using nginx.
  what am i missing?</p>