Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 non-apache web server running on port 8000, but this cannot be accessed from behind corporate firewalls. So, I would like to use my apache 2 server as a proxy to this other web server. I've tried using:

RewriteEngine On
RewriteRule /.* [PT]

... but this does not work; I get:

Bad Request

Your browser sent a request that this server could not understand.

However, it worked fine with [R].


Also, when using ProxyPass, I get this error:


You don't have permission to access / on this server.

share|improve this question

I wouldn't recommend using mod_rewrite for proxying unless you have a reason; mod_rewrite may be more powerful, but it sounds like you wouldn't need it.. For example, it sounds like you just want the following:

# Does't disable ProxyPass; but will disable everything you're not using
ProxyPass off
# Always setup a reverse proxy so that Apache can rewrite the URL
ProxyPass /
ProxyPassReverse /

Make sure you enable mod_proxy (documentation here) as well. Good luck!

share|improve this answer

You want the [P] flag, not [PT]. [PT] on a rewrite rule says 'pass through', allow processing by other handlers (Alias, Redirect etc).

You could also achieve the same results with mod_proxy, starting with something like:

ProxyPass /
share|improve this answer
If I use [P] I get the error: You don't have permission to access / on this server. and using ProxyPass gives a slightly different error. Are you absolutely sure both of those work? – nbolton Sep 6 '10 at 9:40
By default, proxying is disallowed. Look at Basic Examples/Reverse Proxying in that linked URL to fix. – crb Sep 6 '10 at 10:11
Hmm, ok, now I'm getting: [error] proxy: ap_get_scoreboard_lb(0) failed in child 29869 for worker proxy:forward – nbolton Sep 6 '10 at 12:06
Have you restarted Apache, as opposed to just reloading config? – crb Sep 6 '10 at 13:18

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.