ContentNegotiation and ProxyBalancer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi..

I'm using Apache 2.2 with mod_proxy_balancer right
now to run a dynamic RESTful application. This app
caches requests in the Apache DocumentRoot, so a
request can be handled by Apache, once generated.

Right now I'm checking my requests via mod_proxy.
If the file does not exist in the DocumentRoot, it will
get forwarded to the ProxyBalancer:

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://some_proxy%{REQUEST_URI} [P,QSA,L]

This works fine. But this won't handle content
negotiations. I'm caching the files in the recommended
format "name.lang.format". So my cached files might
be "index.en.html" or "foo.fr.xml".

The MultiView Option allows content negotiation, but
it obviously won't change the REQUEST_FILENAME,
so my rewrite rule will always be true, whenever someone
requests "index.html", but my cache just has a "index.en.html".
I'm not even sure content negotiation will take place,
if i have a RewriteRule.

If i remove the RewriteRule, content negotiation works
as expected.

But I need the RewriteRule to handle all requests,
that has not been cached yet. It would be great to
use the balancer as a ErrorDocument handler, but
unfortunately, that doesn't work.

Is there a way to solve this problem, by either:
- only rewrite, if the document cannot be found
in the DocumentRoot (including content
negotiation)
- use a balancer as a error-handler, if no file could
be found after content negotiation.

Cheers,
 Ben


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux