Proxy forwarding to nutch.war does not work. Need to add some code...
---------------------------------------------------------------------
Key: NUTCH-458
URL: https://issues.apache.org/jira/browse/NUTCH-458
Project: Nutch
Issue Type: Bug
Components: web gui
Affects Versions: 0.8.1
Environment: tomcat/apache/proxy
Reporter: My Nutch
In nutch.war in all jsp files that have this:
String base = requestURI.substring(0, requestURI.lastIndexOf('/'));
You need to change to this:
String forwardedHost = request.getHeader("X-Forwarded-Host");
String base;
if(forwardedHost == null)
{
base = requestURI.substring(0, requestURI.lastIndexOf('/'));
}
else
{
base = request.getScheme() + "://" + forwardedHost;
}
i.e.: You need to see if the request URI [header] has been modified by a proxy
server and if so then use the forwarded host header of that proxy. Otherwise
the HTML page will have a base of an internal computer that outsiders can not
see. This is only a problem because your URLs are not relative but rather you
are using a "base" tag, which is also not the best thing to do. Anyways, I
searched the maillist archive and other people had this problem and hard-wired
their base, but that is not the right way to do it. The code above will fix
this problem, i.e.: I verified it works for Apache 2 proxy server in front of a
tomcat app server that runs nutch.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.