2

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.