Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So im using ProxyPass directives to redirect to an internally hosted API:

ProxyPass /api/ http://internal.api.server/
ProxyPassReverse /api/ http://internal.api.server/

Which all works fine. Unfortunately, the client has a bug in which it can't handle 301/302 redirects properly. The API returns redirections for certain actions, in proper RESTful style, indicating for instance where to go to see the new thing you have just created with a POST.

Anyway, is there any way to configure apache to fetch the content from 302 target location & return it for the original request?

ie, at the moment:

  • browser asks for /api/will-redirect.json
  • apache proxys that to the internal api
  • api respond with 302:/api/final-location.json
  • apache reverse proxies that to the client
  • client dies because it cant deal with 302

What i would like:

  • browser asks for /api/will-redirect.json
  • apache proxys that to the internal api
  • api respond with 302:/api/final-location.json
  • apache fetches /api/final-location.json
  • apache returns the content of /api/final-location.json to the client ( as 200 )

Effectively making the 302's invisible to the client. Possible?

share|improve this question
    
See stackoverflow.com/questions/1144286/… - In short, not without writing your own software to do it –  sam Jun 6 '11 at 3:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.