You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Suneet Shah <su...@gmail.com> on 2011/09/15 19:09:30 UTC

[users@httpd] Mod-Proxy

Hello,

I am trying to setup a reverse proxy to one of our applications, but I am
finding that the page comes up, but all the urls that load the stylesheets
and javascript are all broken.

I have pasted below my configuration. Any thoughts on what I am doing wrong
or overlooked?

<Location "/app/">

ProxyPass http://172.17.2.113:2525/

        ProxyHTMLEnable On
        ProxyHTMLURLMap  /      /app/
        RequestHeader    unset  Accept-Encoding

</Location>

Thanks for your help

Re: [users@httpd] Mod-Proxy

Posted by Suneet Shah <su...@gmail.com>.
Hi Joshua,

thanks for your help with this.
this is application was developed by a 3rd party.
Sounds like this will be fun

Regards,
Suneet


On Thu, Sep 15, 2011 at 1:40 PM, Joshua Stoutenburg <je...@gmail.com>wrote:

> On Thu, Sep 15, 2011 at 10:09 AM, Suneet Shah <su...@gmail.com>
> wrote:
> > Hello,
> >
> > I am trying to setup a reverse proxy to one of our applications, but I am
> > finding that the page comes up, but all the urls that load the
> stylesheets
> > and javascript are all broken.
> >
> > I have pasted below my configuration. Any thoughts on what I am doing
> wrong
> > or overlooked?
> >
> > <Location "/app/">
> >
> > ProxyPass http://172.17.2.113:2525/
> >
> >         ProxyHTMLEnable On
> >         ProxyHTMLURLMap  /      /app/
> >         RequestHeader    unset  Accept-Encoding
> >
> > </Location>
> >
> > Thanks for your help
> >
> >
>
> Coincidentally, I've been researching reverse proxy and found this:
> http://www.apachetutor.org/admin/reverseproxies#d8
>
> It looks like you have to do some extra work to write rules that match
> and rewrite all the urls throughout the html, css, javascript, etc.
>
> When I build a web application, I am very, very careful to write all
> urls so that the application can be moved from one server to another
> without breaking.  I use an approach I call "dynamic absolute" where
> the application dynamically detects its location in the file system
> and defines that as a constant for the rest of the application to use,
> then determines the proper http/https url, defining that as a constant
> as well.  Then throughout the application, I use the constants, rather
> than literally typed url.  The end result is absolute urls.
>
> If you didn't have any part in building the application, I apologize.
>
> I consider problems with urls to be a "code smell", specifically
> "Excessive use of literals" (http://en.wikipedia.org/wiki/Code_smell).
>
> Usually, where there is one code smell likely to be many more.  So
> watch out and good luck!
>
> ---------------------------------------------------------------------
> 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] Mod-Proxy

Posted by Joshua Stoutenburg <je...@gmail.com>.
On Thu, Sep 15, 2011 at 10:09 AM, Suneet Shah <su...@gmail.com> wrote:
> Hello,
>
> I am trying to setup a reverse proxy to one of our applications, but I am
> finding that the page comes up, but all the urls that load the stylesheets
> and javascript are all broken.
>
> I have pasted below my configuration. Any thoughts on what I am doing wrong
> or overlooked?
>
> <Location "/app/">
>
> ProxyPass http://172.17.2.113:2525/
>
>         ProxyHTMLEnable On
>         ProxyHTMLURLMap  /      /app/
>         RequestHeader    unset  Accept-Encoding
>
> </Location>
>
> Thanks for your help
>
>

Coincidentally, I've been researching reverse proxy and found this:
http://www.apachetutor.org/admin/reverseproxies#d8

It looks like you have to do some extra work to write rules that match
and rewrite all the urls throughout the html, css, javascript, etc.

When I build a web application, I am very, very careful to write all
urls so that the application can be moved from one server to another
without breaking.  I use an approach I call "dynamic absolute" where
the application dynamically detects its location in the file system
and defines that as a constant for the rest of the application to use,
then determines the proper http/https url, defining that as a constant
as well.  Then throughout the application, I use the constants, rather
than literally typed url.  The end result is absolute urls.

If you didn't have any part in building the application, I apologize.

I consider problems with urls to be a "code smell", specifically
"Excessive use of literals" (http://en.wikipedia.org/wiki/Code_smell).

Usually, where there is one code smell likely to be many more.  So
watch out and good luck!

---------------------------------------------------------------------
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