Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a backend server running on from the local network, which serves similar to this:

/ (root)
| |_www/
| |_private/

Accessing of course, contains 'www' and 'private' folders and is proxied through a public server using Apache's Reverse Proxy. I'd like it so the following happens:

http://public-proxy-server/user1/ actually shows the content from without indicating it in the URL. (/private/ would not be accessible via the public proxy server).

The key here, is for it to be dynamic, so all requests to http://public-proxy-server/*/should show content from*/www/. Again, the proxy currently works fine; below is the config:

(On the public server)

<VirtualHost *:80>
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia full
        ProxyPass /
        ProxyPassReverse /

(On the backend server)

<VirtualHost *:80>
        #this directory contains folders 'user1' and 'user2'
        DocumentRoot /var/www/
share|improve this question
Is there content that depends on 30x redirects to function (in other words; do you actually need that ProxyPassReverse)? And how about content (images, CSS, javascript) that are linked with absolute paths from the content? – Shane Madden Sep 22 '12 at 19:38
Well it's simply just proxying the content from an internal server, all files (images, stylesheets, etc) are served like it would be externally. There's no need to 'redirect' per se, but just 'rewrite' the URL internally. That's all I'm going for. To serve the content of the '/user/www' folder without showing the 'www' in the URL. The only (and main) problem is the wildcard. Basically I need the DocumentRoot on the proxy server to be set to /username/www (append the www). It doesn't matter if that happens on the public or proxy server. Am I making any sense? – ionFish Sep 23 '12 at 1:12
up vote 2 down vote accepted

On the reverse proxy server, use a ProxyPassMatch:

ProxyPassMatch ^/([^/]+)/(.*)$$1/www/$2

And you'll probably still want the / root proxying, so keep that ProxyPass in place - just make sure it's below the ProxyPassMatch, since they're checked in order.

share|improve this answer
Ah, finally. Worked as intended. I was trying mod_rewrite and related. Even the [P] flag. – ionFish Sep 24 '12 at 10:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.