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'm creating a Facebook client for a very limited device - its web browser (ANT Galio) does not handle properly HTTP302 for source of images.

My UC looks like this - in web application markup profile images are placed in the manner:

<img src="http://reverseproxyfqdn/" />

When proxy asks for it gets HTTP 302 redirect to different address, for example This response is reverse proxied to web browser with Location header changed to reverseproxyfqdn/ All the web browsers I've tested handle it properly, but not ANT Galio. I need to return image got from directly as a response to reverseproxyfqdn/ - so do not expose the whole HTTP 302 redirect story to the web browser.

Does anyone know how to do it in Nginx or Apache 2.2? I would like to avoid creating a special PHP/Perl/Java app for this and achieve it by HTTP server configuration.

share|improve this question

You should consider the proxy_redirect directive which might help you dealing with this problem.

share|improve this answer
I'm using this directive but this is not what I want. I do not want HTTP server to respond to the browser with modified HTTP 302 (this is what proxy_redirect@nginx or PrxyReverse@Apache does). I want it to send a file which is in Location header. – Daniel Mar 15 '12 at 17:41
Okay, I understood what you want to do. Apparently this is not possible. Nginx is not designed to be used as a forward proxy like Squid (e.g proxy acts as a HTTP client), but only as a reverse proxy. – mishka Mar 17 '12 at 15:12
However I am curious to know (and I expect) if there is a trick to bypass this problem. – mishka Mar 17 '12 at 15:19

Don't send the URLs to the browser in the first place. Instead, resolve them yourself on the server side while you're creating the HTML pages and insert the CDN URLs in their place.

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.