1

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 /.* http://buildbot.synergy-foss.org:8000/builders/ [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].

Update:

Also, when using ProxyPass, I get this error:

Forbidden

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

2 Answers 2

2

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 / http://buildbot.synergy-foss.org:8000/builders/
ProxyPassReverse / http://buildbot.synergy-foss.org:8000/builders/

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

0

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 / http://buildbot.synergy-foss.org:8000/builders/
4
  • 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? Sep 6, 2010 at 9:40
  • By default, proxying is disallowed. Look at Basic Examples/Reverse Proxying in that linked URL to fix.
    – crb
    Sep 6, 2010 at 10:11
  • Hmm, ok, now I'm getting: [error] proxy: ap_get_scoreboard_lb(0) failed in child 29869 for worker proxy:forward Sep 6, 2010 at 12:06
  • Have you restarted Apache, as opposed to just reloading config?
    – crb
    Sep 6, 2010 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .