You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Markus Jelsma (JIRA)" <ji...@apache.org> on 2011/04/01 17:27:06 UTC

[jira] [Closed] (NUTCH-458) Proxy forwarding to nutch.war does not work. Need to add some code...

     [ https://issues.apache.org/jira/browse/NUTCH-458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Jelsma closed NUTCH-458.
-------------------------------

    Resolution: Won't Fix

Bulk close of legacy issues:
http://www.lucidimagination.com/search/document/2738eeb014805854/clean_up_open_legacy_issues_in_jira

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira