Using Apache as a proxy in conjunction with the Apache alias directive

When using ProxyPass in apache, it won’t obey any aliases. Apachectl configtest won’t complain, so you could end up messing around with this for a while (like I did) . For example:

[...]
Alias /foo /absolute/path/to/foo
ProxyPass / localhost:8080
[...]

In the example above the alias directive wont have anything to ‘say’. In my access.log I noticed this when clients trying to access stuff from the alias’ed dir got a 404 .
You can fix this easily by:

Alias /foo /absolute/path/to/foo
ProxyPass /foo !
ProxyPass / localhost:8080

you’re simply telling apache not to oproxy /foo 🙂
Thank you mail-archives.apache.org and httpd.apache.org mod_proxy documentation.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>