Apache modproxy & redirect problem & solution
Hi all. I am using apache modproxy to connect main apache server to internal tomcat server. (usunet.ru/xwiki) and find this problem: On save document, xwiki call redirect by Full URL of Internal server(yh:8080) and got error 404 becouse internal host is inaccessible I fix this problem for by writing in com.xpn.xwiki.web.XWikiServletURLFactory: {code} private URL getServerURL(String xwikidb, XWikiContext context) throws MalformedURLException { final String host = context.getRequest().getHeader("x-forwarded-host"); if (host!=null && !host.equals("")) return new URL("http://"+host); ... {code} (Apache modproxy adds header "x-forwarded-host" = apache host) Maybe better to redirect by uri without server name? -- Artem Melentev, UralSU, CS301. http://usunet.ru/xwiki/ jabber: amelentev@jabber.ru | icq: 175349029
Interesting.. you can commit this.. I'll check why the redirect is by full URL and if it can be by URI Ludovic Artem Melentev wrote:
Hi all.
I am using apache modproxy to connect main apache server to internal tomcat server. (usunet.ru/xwiki) and find this problem:
On save document, xwiki call redirect by Full URL of Internal server(yh:8080) and got error 404 becouse internal host is inaccessible
I fix this problem for by writing in com.xpn.xwiki.web.XWikiServletURLFactory:
{code} private URL getServerURL(String xwikidb, XWikiContext context) throws MalformedURLException { final String host = context.getRequest().getHeader("x-forwarded-host"); if (host!=null && !host.equals("")) return new URL("http://"+host); ... {code}
(Apache modproxy adds header "x-forwarded-host" = apache host)
Maybe better to redirect by uri without server name?
------------------------------------------------------------------------
-- You receive this message as a subscriber of the xwiki-dev@objectweb.org mailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
participants (2)
-
Artem Melentev -
Ludovic Dubost