httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon <jonnumb...@gmail.com>
Subject [users@httpd] Re: proxy & mime type issues
Date Tue, 29 Jan 2008 21:46:20 GMT
> I am running a site with a front end apache web server load balancing
> between multiple backend mod_perl application servers.  I am using the
> proxy, proxy_balancer, and proxy_http modules to do the load
> balancing.  The load balancing is working fine, with the major
> exception being that it serves all files as 'text/html' as oppose to
> their proper mime type (css, jpg, js, etc...).

Further inspection led me to realize that I wasn't actually getting
the file back with the incorrect mime type, but I was getting back an
actual text/html page...my standard web page.

When I looked at the file being returned by wget, it turns out that it
is the sites html page.  Which makes perfect sense given the conf...

>     ProxyPass / balancer://mycluster/ stickysession=BALANCEID nofailover=On
>     ProxyPassReverse / http://app-01/handler/index.cgi
>     ProxyPassReverse / http://app-02/handler/index.cgi
>
>     <Proxy balancer://mycluster>
>         BalancerMember http://app-01/handler/index.cgi  route=http1
>         BalancerMember http://app-02/handler/index.cgi  route=http2
>         ProxySet lbmethod=byrequests
>     </Proxy>

is sending all requests to /handler/index.cgi which is where the
mod_perl handler is (index.cgi is just a decoy).  So, when it tries to
go to /media (or anywhere else for that matter) it actually goes to
/handler/index.cgi/media which doesn't exist.

So, now the real problem, is how do I properly load balance the
requests to /media and send them to the right place?

One solution is to change the configuration of the mod_perl app servers...

The other solution is to add the following directive...

ProxyPass /media http://app-01/media

Unfortunately though these requests will not be load balanced now.
Luckily the media dir is an nfs mount run on a different server, so I
am just going to direct the ProxyPass there directly.

ProxyPass /media http://nfs/media

Maybe not ideal, but it works.

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


Mime
View raw message