I have a question I’m fairly certain I already know the answer to, but just in case there are some really smart people that know something I don’t, I figured I’d ask.
Say I have a scenario where I have three servers, A, B, and C. A requests a file from B. B is actually just kind of middle man, does some processing, and figures out where the file is on server C.
WITHOUT doing a redirect, is there any way to pass along that file from C to A without having to first pull it to B and push from there to A?
I can’t think how this would be possible (without a redirect), but I figured I’d ask anyways just in case there was some magic trick I didn’t know.
What is the processing? You might be able to handle it with a reverse proxy depending on what happens there.
It actually varies.
Some of it is loading and processing pages (compiling scripts, etc). Some of it is just straight image patch through (images are on server C and I want server B to let server A know without server A knowing about server C).
If I wanted to do just the image portion like that, is there anything I could get it to do what I want. That’s actually the big one I want to do.
Images would be pretty easy with a reverse proxy. Personally, I’d use nginx if I had to pick but most modern web server stacks can do it.* It still will be pulling the file through it, but with most reverse proxies you can setup some pretty aggressive caching so a very small percentage of requests really make the round trip.
- Note there is a big security bug with Apache’s reverse proxy module as of today.
Thanks, I’ll look into that.
We’d likely use Nginx too since we’ve started rolling out most of our boxes with nginx on them (so much faster than Apache =p).
I’ve got a fond spot for nginx myself. Not only is it real, real fast, the config file is not an insane hodgepodge of different grammars.