httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Woodworth" <mirkp...@gmail.com>
Subject [users@httpd] ProxyPass nocanon causes css files to have type text/plain
Date Thu, 23 Oct 2008 21:19:28 GMT
Hi,

I am using mod_proxy as the reverse proxy in our application.  I need
mod_proxy to send the request through to the backend server w/o adding
or removing any encodings from the URL.  I also have
AllowEncodedSlashses on.  But what's happening is that some things
that are encoded in the URL submitted by the client are being unecoded
by httpd, e.g. %26 is turned into a literal &.  This is causing the
backend application server to break because it expects the URL to be
encoded.

For the record, it seems bad that %26 is turned into a & -- a &
normally designates a CGI argument split, but in this case it's
actually the value of a CGI argument so it needs to be encoded.

Changing the back-end application server is also not an option.  So I
need Apache to just send the URL through w/o changing it.

So I tried using the nocanon argument to ProxyPass, which looks like
it was going to work fine.  But nocanon causes httpd to incorrectly
tags certain .css and .js files as text/plain.  This is only when the
back-end server doesn't send a Content-Type header, and the file has a
CGI argument, such as:

/css/style.css?12345
/js/main.js?12345

When there is a ?12345 in the URL, and nocanon is ON (don't
canonicalise), then httpd "breaks" and for whatever reason isn't able
to figure out that the file is a .css or .js file and appends a
"Content-Type: text/plain" header instead of the appropriate type.

With nocanon OFF, then httpd adds the correct type headers for these files.

My guess is that the ?12345 CGI argument to the .css and .js files
does something weird to httpd when using nocanon.  I don't know what,
though.  I bet that this is a problem for any file that doesn't have a
content-type header from the server -- httpd will just default to
text/plain for everything.

Is using "nocanon" the correct Apache option to use here?  Is this
problem with the .css and .js types a bug in Apache?  Is there a
better way to do what I want -- send the URLs through w/o changing
them?  Are there any drawbacks to doing so?

Thanks,
Adam

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