You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Arne Berner <ab...@practical.no> on 2009/03/06 15:14:33 UTC

[users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Hi,

I have a  Apache/2.2.8 running as a reverse proxy in front of a .Net
application using Ajax and the gaia framework (gaiaware.net)
I have setup several ProxyHTMLURLMap for to rewrite the responses from
the application, and this works great for html content and javascript
embeded in the html.
But not for HTTPResponses with javascript only.
      The request is a HTTP Post to /myproxyurl/Default.aspx HTTP/1.1

I get the following response from the application:

  HTTP/1.1 200 OK
  Date: Fri, 06 Mar 2009 14:05:20 GMT
  Server: Microsoft-IIS/7.0
  Cache-Control: no-cache
  Pragma: no-cache
  Content-Length: 60180
  Content-Type: application/x-javascript; charset=utf-8
  Expires: -1
  X-AspNet-Version: 2.0.50727
  X-Powered-By: ASP.NET
  Keep-Alive: timeout=5, max=96
  Connection: Keep-Alive

  $incJs('/MyApp/WebResource.axd?d=dGQs8ne3u7b0K7EaoETbR_FwF8zjp0AaLHXg0ndOpW1BmZAzE7hWisLR446zo..............

I would like to rewrite the /MyApp/ to /myproxyurl/ as I've done in
the html responses with the following ProxyHTMLURLMap:

  <Location /myproxyurl/>
                ProxyHTMLExtended On
                SetOutputFilter proxy-html
                ProxyHTMLURLMap /MyApp/WebResource.axd
/myproxyurl/WebResource.axd
                ProxyHTMLURLMap MyApp/ myproxyurl/
                ProxyHTMLDoctype XHTML Legacy
  </Location>



regards from Arne Berner

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Arne Berner wrote:
> 
> I get the following response from the application:
> 
> I would like to rewrite the /MyApp/ to /myproxyurl/ as I've done in
> the html responses with the following ProxyHTMLURLMap:

That's in the request body... please have a look at mod_substitute (2.2)
(soon to become mod_sed in 2.4).

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by "Florian S." <fl...@gmx.net>.
Hi,

I'm not a pro, but my way would be patching/editing mod_proxy_html.c for
myself:

Searching for 'text/html' would lead you to line 1024, where an error
message is set for a content type not being html or xhtml+xml. If a
message is set, it will end up processing by ap_remove_output_filter
some lines below (I dare interpret it that way).
Adding the desired content-type in the if statement could resolve your
problem.

Hope, that may help,
Florian


Am Freitag, den 06.03.2009, 17:29 -0500 schrieb Brian Mearns:
> On Fri, Mar 6, 2009 at 5:02 PM, Flowering Weeds
> <fl...@hotmail.com> wrote:
> >
> >>
> >> That was not the question. But when you ask...
> >
> > Hey thanks for the answer.
> >
> >> - The apache has a SUN Access Manager plugin (not supported on IIS7)
> >
> > I don't use this but since one is using IIS 7 I looked at
> >
> > http://docs.sun.com/app/docs/doc/819-4669/adrab?a=view
> >
> > How Access Manager Works
> >
> > And since I don't use this (I could be wrong)
> > but a lot of this is all in http.sys itself. I'm
> > sure there is much more to this Access Manager!
> >
> > But for certain users for certain access and etc.
> > can be done for https.sys aware products.
> >
> > When one is not busy, (and I know we all never are not busy)
> > perhaps take a look at setting up http.sys for certain
> > users only access (databases, web services, etc.)
> >
> > Http.sys is not just for IIS7!
> > It is for any Windows HTTP usage.
> > A lot of products use http.sys.
> > ASF can use http.sys too.
> >
> >> - The apache is running mod_security. Is there a equivalent om IIS?
> >
> > Not needed but perhaps look up URLScan.
> >
> > Using Windows PowerShell yet?
> >
> > Yep change is tough on all of us!
> 
> Enough with http.sys, already! If you think MS offers better solutions
> than Apache, then by all means, use them! But this is the *apache*
> user's list. I've never even seen your name on this list before the
> past two days, and so far every message you've posted has been about
> http.sys or .NET or IIS. It seems like the only reason you signed up
> for this list in the first place is to evangelize over the great and
> powerful Microsoft. If you have nothing apache related to actually
> contribute to this community, then please just head back to redmond
> and leave us to our own.
> 
> Thank you,
> -Brian
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Re: help with mod_proxy_html, trouble rewriting javascript content

Posted by Flowering Weeds <fl...@hotmail.com>.

 

> One thing my apache do, or rather the sun access manager do, is saml2.
> Something That the big M dos'nt support.
> 


I know little about that, but that doesn't mean that 

there are not other ways of doing things and sometimes

one must make a change.  But I understand too!

 

Hope it works out!

 

 

 

 

_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009

[users@httpd] Re: help with mod_proxy_html, trouble rewriting javascript content

Posted by Arne Berner <ab...@practical.no>.
One thing my apache do, or rather the sun access manager do, is saml2.
Something That the big M dos'nt support.

Please... Back to my original question.


Arne

2009/3/7, Peter Schober <pe...@univie.ac.at>:
> * Flowering Weeds <fl...@hotmail.com> [2009-03-07 17:03]:
>> Thanks for helping to explain http.sys.
>
> *plonk*
>
> cheers,
> -peter
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

-- 
Sendt fra min mobile enhet

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Peter Schober <pe...@univie.ac.at>.
* Flowering Weeds <fl...@hotmail.com> [2009-03-07 17:03]:
> Thanks for helping to explain http.sys.

*plonk*

cheers,
-peter

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Brian Mearns <me...@gmail.com>.
On Sat, Mar 7, 2009 at 11:03 AM, Flowering Weeds
<fl...@hotmail.com> wrote:
>
>
>> >
>> > When one is not busy, (and I know we all never are not busy)
>> > perhaps take a look at setting up http.sys for certain
>> > users only access (databases, web services, etc.)
>> >
>> > Http.sys is not just for IIS7!
>> > It is for any Windows HTTP usage.
>> > A lot of products use http.sys.
>> > ASF can use http.sys too.
>> >
>> >> - The apache is running mod_security. Is there a equivalent om IIS?
>> >
>> > Not needed but perhaps look up URLScan.
>> >
>> > Using Windows PowerShell yet?
>> >
>> > Yep change is tough on all of us!
>>
>> Enough with http.sys, already!
>
> Hey we all agree so one port for all HTTP
> access from any number of processes (even
> a process from anywhere in the world) to do
> admin actions, web serving and whatever,
> is the safest on one sharing port, right?
>
> And that Apache users will never again let a
> Apache user say only one process per port for
> the following protocols HTTP, TCP, PIPES, and
> MESSAGE, right?
>
> And that putting an Apache (any OS) web server
> in front of IIS (like IIS 6, IIS 7, and IIS7.5) is in
> no way ever needed, right?
>
>> > Yep change is tough on all of us!
>>
>> Enough with http.sys, already!
>
> Yep it's time to learn how to get any type of tracking
> (grep gps charting) using a .NET process, Windows
> PowerShell that is now included in AD, Exchange, and
> many other products that Apache (all OS) users use
> everyday, and talk about in this list).
>
> Thanks for helping to explain http.sys.

Alright Gates, the jig it up, we know it's you.

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Flowering Weeds <fl...@hotmail.com>.

 

> >
> > When one is not busy, (and I know we all never are not busy)
> > perhaps take a look at setting up http.sys for certain
> > users only access (databases, web services, etc.)
> >
> > Http.sys is not just for IIS7!
> > It is for any Windows HTTP usage.
> > A lot of products use http.sys.
> > ASF can use http.sys too.
> >
> >> - The apache is running mod_security. Is there a equivalent om IIS?
> >
> > Not needed but perhaps look up URLScan.
> >
> > Using Windows PowerShell yet?
> >
> > Yep change is tough on all of us!
> 
> Enough with http.sys, already! 

 

Hey we all agree so one port for all HTTP

access from any number of processes (even 

a process from anywhere in the world) to do

admin actions, web serving and whatever,

is the safest on one sharing port, right?

 

And that Apache users will never again let a

Apache user say only one process per port for

the following protocols HTTP, TCP, PIPES, and 

MESSAGE, right?

 

And that putting an Apache (any OS) web server

in front of IIS (like IIS 6, IIS 7, and IIS7.5) is in

no way ever needed, right?

 

> > Yep change is tough on all of us!
> 
> Enough with http.sys, already! 

 

Yep it's time to learn how to get any type of tracking

(grep gps charting) using a .NET process, Windows 

PowerShell that is now included in AD, Exchange, and 

many other products that Apache (all OS) users use 

everyday, and talk about in this list).

 

Thanks for helping to explain http.sys.

 

 

 

_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009

Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Brian Mearns <me...@gmail.com>.
On Fri, Mar 6, 2009 at 5:02 PM, Flowering Weeds
<fl...@hotmail.com> wrote:
>
>>
>> That was not the question. But when you ask...
>
> Hey thanks for the answer.
>
>> - The apache has a SUN Access Manager plugin (not supported on IIS7)
>
> I don't use this but since one is using IIS 7 I looked at
>
> http://docs.sun.com/app/docs/doc/819-4669/adrab?a=view
>
> How Access Manager Works
>
> And since I don't use this (I could be wrong)
> but a lot of this is all in http.sys itself. I'm
> sure there is much more to this Access Manager!
>
> But for certain users for certain access and etc.
> can be done for https.sys aware products.
>
> When one is not busy, (and I know we all never are not busy)
> perhaps take a look at setting up http.sys for certain
> users only access (databases, web services, etc.)
>
> Http.sys is not just for IIS7!
> It is for any Windows HTTP usage.
> A lot of products use http.sys.
> ASF can use http.sys too.
>
>> - The apache is running mod_security. Is there a equivalent om IIS?
>
> Not needed but perhaps look up URLScan.
>
> Using Windows PowerShell yet?
>
> Yep change is tough on all of us!

Enough with http.sys, already! If you think MS offers better solutions
than Apache, then by all means, use them! But this is the *apache*
user's list. I've never even seen your name on this list before the
past two days, and so far every message you've posted has been about
http.sys or .NET or IIS. It seems like the only reason you signed up
for this list in the first place is to evangelize over the great and
powerful Microsoft. If you have nothing apache related to actually
contribute to this community, then please just head back to redmond
and leave us to our own.

Thank you,
-Brian

-- 
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from: http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Flowering Weeds <fl...@hotmail.com>.

> 
> That was not the question. But when you ask...

 

Hey thanks for the answer.


> - The apache has a SUN Access Manager plugin (not supported on IIS7)


I don't use this but since one is using IIS 7 I looked at

 

http://docs.sun.com/app/docs/doc/819-4669/adrab?a=view


How Access Manager Works

 

And since I don't use this (I could be wrong)

but a lot of this is all in http.sys itself. I'm

sure there is much more to this Access Manager!

 

But for certain users for certain access and etc. 

can be done for https.sys aware products.

 

When one is not busy, (and I know we all never are not busy)

perhaps take a look at setting up http.sys for certain

users only access (databases, web services, etc.)

 

Http.sys is not just for IIS7! 

It is for any Windows HTTP usage.

A lot of products use http.sys.

ASF can use http.sys too.

 

> - The apache is running mod_security. Is there a equivalent om IIS?


Not needed but perhaps look up URLScan.

 

Using Windows PowerShell yet?

 

Yep change is tough on all of us!

 

 


_________________________________________________________________
Windows Live™: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009

Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Arne Berner <ab...@practical.no>.
That was not the question. But when you ask...
- The apache has a SUN Access Manager plugin (not supported on IIS7)
- The apache is running mod_security. Is there a equivalent om IIS?

so back to the question about rewrite of javascript requests...


2009/3/6 Flowering Weeds <fl...@hotmail.com>:
>
>
>>
>> I have a  Apache/2.2.8 running as a reverse proxy in front of a .Net
>> application using Ajax and the gaia framework (gaiaware.net)
>
> Why?  One already has http.sys,
> the safest HTTP usage today!
>
> Run either Apache or IIS 7
> no need for both is there?
>
>>> I get the following response from the application:
>>
>> HTTP/1.1 200 OK
>> Date: Fri, 06 Mar 2009 14:05:20 GMT
>> Server: Microsoft-IIS/7.0
>
>
>
>
> ________________________________
> Windows Live™ Contacts: Organize your contact list. Check it out.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Flowering Weeds <fl...@hotmail.com>.

 

> 
> I have a  Apache/2.2.8 running as a reverse proxy in front of a .Net
> application using Ajax and the gaia framework (gaiaware.net)

 

Why?  One already has http.sys,

the safest HTTP usage today!

 

Run either Apache or IIS 7

no need for both is there?


>> I get the following response from the application:
> 
> HTTP/1.1 200 OK
> Date: Fri, 06 Mar 2009 14:05:20 GMT
> Server: Microsoft-IIS/7.0


 

 

_________________________________________________________________
Windows Live™ Contacts: Organize your contact list. 
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009

Re: [users@httpd] help with mod_proxy_html, trouble rewriting javascript content

Posted by Krist van Besien <kr...@gmail.com>.
On Fri, Mar 6, 2009 at 3:14 PM, Arne Berner <ab...@practical.no> wrote:
> Hi,
>
> I have a  Apache/2.2.8 running as a reverse proxy in front of a .Net
> application using Ajax and the gaia framework (gaiaware.net)
> I have setup several ProxyHTMLURLMap for to rewrite the responses from
> the application, and this works great for html content and javascript
> embeded in the html.
> But not for HTTPResponses with javascript only.

Generally my approach to solve such problems is to look at the backend
first. Most webapplications I have come across, regardless of what
they were programmed in, had a user settable "base url" that the
application would use whenever it needed to generate a url.
Setting this base url to that of the outside server generally solves
all the problems with bad links and redirects.

So if you for example have www.mysite.com as a forward proxy for
myinternalappserver.local all you need to do is tell the application
on your appserver to use www.mysite.com as basis for any url it
generates, in stead of its own host name. The configuration of your
reverse proxy then becomes trivial.

Krist



-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org