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

We have an application server located at .

It needs to be accessed via http:// wibble/foo using reverse proxying.

This I've managed, however there is stuff in http:// which references from /



So it's trying to get http:// wibble/images/blah.jpg instead of

http:// wibble/foo/images/blah.jpg

Any idea how I can get it to insert the /foo prefix for anything referenced from / ?

share|improve this question
is this http:// wibble/images/blah.jpg comming from the html page ? – silviud Dec 20 '10 at 17:57
Yes, the pages refer to /images/blah.jpg so the client is requesting the file from http:// wibble/images/blah.jpg instead of http:// wibble/foo/images/blah.jpg – Squeeb Dec 20 '10 at 18:14

mod_proxy never modifies the HTML.

Only the HTTP response headers specifically mentioned above will be rewritten. Apache will not rewrite other response headers, nor will it rewrite URL references inside HTML pages. This means that if the proxied content contains absolute URL references, they will by-pass the proxy. A third-party module that will look inside the HTML and rewrite URL references is Nick Kew's mod_proxy_html.

share|improve this answer

If you are using nginx as your front-end server, you can use the HttpSubModule to perform the substitution. Essentially, nginx should proxy the request and perform the substitution on the returned text. I do believe though, that you can't use this if you have compression on the backend (so as long as you have compression on the front-end server you should be fine):

Essentially: Nginx -> proxy to apache -> return to Nginx -> perform substitution -> compress and serve

I presume a similar module exists for Apache and other servers.

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.