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

Not sure if this is the right stack exchange to post this. If there is a better place please redirect me - thanks.

I enabled these lines in httpd.conf:

LoadModule proxy_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_http_module modules/

Then I added these lines:

ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all

ProxyPass /goo
ProxyPassReverse /goo

If I open up my browser and go to this URL:


I get redirected to:

I expected that mod_proxy would act like a proxy and not just redirect to google. I would expect that my browser should NOT know that exists and should only know about the existance of the proxy server.

  1. What is going on here?
  2. Is this not what mod_proxy was designed for?
  3. Is there something else that I should be using instead?
share|improve this question

migrated from Jul 30 '13 at 21:51

This question came from our site for pro webmasters.

up vote 3 down vote accepted
  1. What is going on here?

Well, let's take a look at

$ curl -D /dev/stdout
HTTP/1.1 301 Moved Permanently
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<H1>301 Moved</H1>
The document has moved
<A HREF="">here</A>.

And there's your redirect. Google does this on,, and probably others.

  1. Is this not what mod_proxy was designed for?

Sure. It's doing exactly what you asked it to's fetching content from and returning it verbatim to your client.

  1. Is there something else that I should be using instead?

If you really want to act like a generic forward proxy on a particular URL, you're probably going to need to investigate mod_proxy_html, which can be used to rewrite links in content fetched from a remote server.

But in general, it's really hard to prevent a remote site from performing this sort of redirect (because even if you rewrite links in the Location header, in <A> tags, and elsewhere, you may miss some Javascript or something...)

share|improve this answer
Great Answer +1 – Simon Hayter Jul 31 '13 at 6:43
So in conclusion: mod_proxy will continue to run links through the proxy only if they are relative URLs. – sixtyfootersdude Jul 31 '13 at 13:42
Technically: your browser will only continue to run links through the proxy as long as they point to your proxy. – larsks Jul 31 '13 at 14:48

mod_proxy will in fact rewrite "Location," "Content-Location," and "URI" headers on HTTP redirect responses. As explained in larsks' answer the 301 google is doing causes

ProxyPassReverse /goo

to be ineffectual because the redirect to does not match.

You could try adding

ProxyPassReverse /goo

but it isn't clear what you are trying to accomplish.

share|improve this answer

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.