You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Domingos Parra Novo <do...@terra.com.br> on 2006/05/28 15:32:28 UTC

[users@httpd] problems using "Alias" directive on Vhosts with rewrite+proxy

Hiyas,

I've been using apache 1.3 as a proxy server for a few years. A few days ago, I finally updated my webservers, to run apache 2.0.58 (was using 1.3.33 before).

But, I found a really strange issue on this update. I had a VirtualHost configuration which basically checked if a file was present on an NFS location, and if not present, simply redirects the request (by means of mod_proxy) to a backend server (which would answer the request, and then write the file on the shared NFS storate). This configuration works ok on Apache 2.0.

Strange enough, I had a "Alias" directive, which would define a virtual path, containing only static content (IE, the "RewriteCond" should always find the file on that dir, as long as the defined "Alias" is respected). This worked really ok on Apache 1.3, but on Apache 2.0, this keyword seems to "desapear" from the server configuration. I tried to use "AliasMatch" too, but it didn't solve the issue.

Then, I checked with mod_info which rules where parsed by the webserver, and saw that the Alias wasn't even present. But, if I remove all the rewrite stuff from my VirtualHost configuration, the Alias starts to work as expected, and mod_info shows the parsed Alias, as expected.

Just as a FIY, this is a sample of my VirtualHost configuration:

<VirtualHost>
ServerName frontend.domain.com
Options IncludesNOEXEC FollowSymLinks MultiViews
DocumentRoot /usr/local/apache/virtual/frontend-backend
DirectoryIndex index.html
Alias /static /usr/local/apache/virtual/static
ProxyRequests off
RewriteEngine on
#RewriteLog logs/rewrite_log
RewriteLogLevel 0
RewriteCond %{REQUEST_FILENAME} \.(htm|html|wml|xml)$
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteRule ^/(.*)$ http://backend.domain.com/$1 [P,L]
</VirtualHost>

Thanks in advance,

Domingos.

-- 
Domingos Parra Novo
Terra Networks Brasil
domingosnovo AT terra DOT com DOT br


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