Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem mit mod_proxy_html

4 views
Skip to first unread message

Dirk Taggesell

unread,
Nov 29, 2005, 5:28:20 AM11/29/05
to
Hello Apache users,

Recently I sat up a reverseproxy (Apache 2.0.53, FreeBSD) for providing
Outlook Web-Access to a certain group of users.

What makes it somewhat sophisticated is that the reverseproxy itself is
located behind a firewall and has only a local IP address. So it has to
rewrite every (internal) hostname or IP address in html documents to the
external hostname that is seen from the outside.

With mod_proxy_html this works for all the occurances in normal html source
but the modul refuses to rewrite internal addresses into CSS descriptions.
(I managed to have the hostname rewritten whenever it occurs in Javascript
parts of the documents)
If I look into the source of the delivered document it still shows the
internal URL in between CSS statements.

My Configuration is as follows:
ProxyPass / http://10.11.12.13/
ProxyPassReverse / http://10.11.12.13/

SetOutputFilter proxy-html
ProxyHTMLExtended On
ProxyHTMLURLMap 'http://10.11.12.13' 'https://hostname.example.com'

The host 10.11.12.13 is the Windows Server delivering the OWA documents,
'https://hostname.example.com' is the hostname for access from the outside.

Most likely my filter definition is not entirely correct, but the several
documentations on the mod_proxy_html website don't help me much.

Can anyone of you give me some help? Or a workaround?

For instance, one of the culprits looks this way:

<div id="idMsgViewer" class="msgViewer" accesslevel="63" acceptlang="de"
rowsperpage="25" url="http://10.11.12.13/exchange/dirk/Inbox/"
onready="onViewReady()" onrefresh="onViewRefresh()"
onbeforerefresh="onBeforeViewRefresh()" onkeydown="onViewKeyDown()"
onkeypress="onViewKeyPress()" oncontextmenu="return(false);"
refreshthreshold="20%" viewdescriptor="xmlDefaultView"
onchangesort="persistSortOrder()" onerror="onViewError()"
onnavigate="onViewNavigation()" onselectionchange="updatePreviewPane()"
allowquickflag="1" followuptext="Nachverfolgung" loadingtext="Wird geladen"
nextseldir="1">

--
Thanks in advance
Dirk Taggesell

Message has been deleted

Dirk Taggesell

unread,
Nov 29, 2005, 8:34:30 AM11/29/05
to
Am Tue, 29 Nov 2005 11:39:46 +0100 schrieb Davide Bianchi:

> Have you thought of using just the hostname instead of the IP
> address and using always the same hostname? That would remove the
> problem at the root.

But the host the reverse proxy fetches the pages from has no DNS hostname
that can be reached/seen from the outside. So this is no option.

May be I can trick the IIS that hosts the Outlook Web-Access pages into
delivering the external hostname to begin with. but I am not sure whether
that is possible.

And regardless, mod_proxy_html should be able to correctly rewrite also
URLs into CSS - as the documentation claims. I think that only my replace
pattern line is not complete.

--
mit freundlichen Grüßen
Dirk Taggesell

Message has been deleted

Dirk Taggesell

unread,
Nov 29, 2005, 1:07:07 PM11/29/05
to
Am Tue, 29 Nov 2005 14:52:56 +0100 schrieb Davide Bianchi:

> See also http://www.soft-land.org/articoli/exch

Many thanks!
Will try that.

jeffrey...@gmail.com

unread,
Nov 30, 2005, 5:13:59 PM11/30/05
to
Hi Dirk,

I don't think mod_proxy_html handles that as is. It's an easy fix
though, or at least it appears to be.

The code as stands contains this:

static const char* href[] = { "href", NULL } ;
static const char* cite[] = { "cite", NULL } ;
static const char* action[] = { "action", NULL } ;
static const char* imgattr[] = { "src", "alt", "longdesc", "usemap",
"ismap", NULL } ;
static const char* inputattr[] = { "src", "usemap", NULL } ;
static const char* scriptattr[] = { "src", "for", NULL } ;
static const char* frameattr[] = { "src", "longdesc", NULL } ;
static const char* objattr[] = { "classid", "codebase", "data",
"usemap", NULL } ;
static const char* profile[] = { "profile", NULL } ;
static const char* background[] = { "background", NULL } ;
static const char* codebase[] = { "codebase", NULL } ;

static const elt_t linked_elts[] = {
{ "a" , href } ,
{ "img" , imgattr } ,
{ "form", action } ,
{ "link" , href } ,
{ "script" , scriptattr } ,
{ "base" , href } ,
{ "area" , href } ,
{ "input" , inputattr } ,
{ "frame", frameattr } ,
{ "iframe", frameattr } ,
{ "object", objattr } ,
{ "q" , cite } ,
{ "blockquote" , cite } ,
{ "ins" , cite } ,
{ "del" , cite } ,
{ "head" , profile } ,
{ "body" , background } ,
{ "applet", codebase } ,
{ NULL, NULL }
} ;

Into the first group trying adding:
static const char* div[] = { "div", NULL } ;
and in the second list add:
{"div", div},

That should work.

-Jeff

Dirk Taggesell

unread,
Dec 1, 2005, 10:31:38 AM12/1/05
to
Am 30 Nov 2005 14:13:59 -0800 schrieb jeffrey...@gmail.com:

> Hi Dirk,
>
> I don't think mod_proxy_html handles that as is. It's an easy fix
> though, or at least it appears to be.
>
> The code as stands contains this:

[snipped]

Thanks, I will try that one out.

Dirk Taggesell

unread,
Dec 3, 2005, 6:59:39 AM12/3/05
to
Am 30 Nov 2005 14:13:59 -0800 schrieb jeffrey...@gmail.com:

[source snipped]
> That should work.

I tried it, but nothing chanded. I deleted the existing module in
/usr/local/libexec/apache2 prior to installing the patches one.

I installed it according to
<http://www.apacheweek.com/features/reverseproxies>

with:
> apxs -c -I/usr/local/include/libxml2 -i mod_proxy_html.c

(it is a FreeBSD)
and the new module appears in /usr/local/libexec/apache2
as intended. Apache restarts without problems.

There is still the internal IP address in the html source.

jeffrey...@gmail.com

unread,
Dec 5, 2005, 6:06:18 PM12/5/05
to
I'm sorry, I think I made a typo. The first array should contain the
attribute that you expect to contain a URL. So instead of:

static const char* div[] = { "div", NULL } ;

you'll want:

static const char* div[] = { "url", NULL } ;

Hope that works better.

-Jeff

Dirk Taggesell

unread,
Dec 6, 2005, 8:34:04 AM12/6/05
to
Am 5 Dec 2005 15:06:18 -0800 schrieb jeffrey...@gmail.com:

> Hope that works better.

Better, yes. The internal IP addresses in the div declarations have gone,
but I still have things like this in the html docs:

<span id="idHelpLinkText" style="display:none;">
http://10.11.12.13/exchweb/help/GER/ie5/default.htm?noteview.htm
</span>

Maybe the "span" element has to be added to the definition in the C++
source as well, but adding

static const char* span[] = { "url", NULL } ;

and

{ "span", span },

didn't help (was just a rough guess, as i am nearly C++ illiterate).

0 new messages