proxy & mime type issues

proxy & mime type issues

am 28.01.2008 05:58:43 von Jon

Hello,

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

To ensure that the proxy is at fault I have attempted to retrieve
files of various types using wget through the proxy, and directly to
the application servers. When going through the proxy all files are
served as 'text/html', but when connecting directly to an application
server I get the proper type returned.

I am running Apache 2.2.6 on a Linux server w/o mod_perl on the web
server, and Apache 2.2.6 w/ mod_perl (w/o proxy modules) on the
application servers.

The mime_module is loaded, and functioning correctly on the web
server. All files that I serve directly off of the web server are
served with their correct mime type. This issue only occurs when the
files come through the proxy.

I am guessing that I must have some kind of incorrect configuration,
because I haven't been able to find much on this from extensive
googling. It doesn't seem to be a consistent problem...which makes me
think I'm doing something stupid.

My VirtualHost configuration for the web server is below. I added the
indicated ProxyPass, and Alias directives in order to just get the
basic site css, and images loading correctly. It is not my intention
to serve them off of the proxy web server though, assuming I can get
this working correctly...


ServerAdmin server_admin@site.com
ServerName www.site.com
ServerAlias site.com
DocumentRoot /srv/www/
ProxyRequests off


Order deny,allow
Allow from all


########################################################
# I added this, and am serving the basic style sheet, and standard
# images locally for the time being
########################################################
ProxyPass /styleSheet !
Alias /styleSheet /srv/www/site/data/styleSheet
ProxyPass /img !
Alias /img /srv/www/site/data/img
ProxyPass /js !
Alias /js /srv/www/site/data/js
ProxyPass /logs !
######################################################

ProxyPass /balancer-manager !

ProxyPass / balancer://mycluster/ stickysession=BALANCEID nofailover=On
ProxyPassReverse / http://app-01/handler/index.cgi
ProxyPassReverse / http://app-02/handler/index.cgi


BalancerMember http://app-01/handler/index.cgi route=http1
BalancerMember http://app-02/handler/index.cgi route=http2
ProxySet lbmethod=byrequests



SetHandler balancer-manager
Order deny,allow
Allow from localhost




Thanks for the help,

- jon