Webmasters Stack Exchange is a question and answer site for pro webmasters. 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 have an app that runs inside my firewall and talks out to multiple end points via HTTP/HTTPS on a non-standard port e.g. http://endpoint1.domain.com:7171, http://endpoint2.domain.com:7171

What I want to do is route these requests through a forward proxy that then rewrites the URL to something like http://allendpoints.domain.com/endpoint1 (port 80 or 443) then on the other end have a reverse proxy that unwinds what I did on the forward proxy to reach the specific endpoints.

The result being that I can route existing app requests through to specific endpoints across the internet without having to change my app software.

My questions are:

  1. is this even possible?
  2. is it a good idea, are their better ways to do this?
  3. Can this be done with IIS and Apache as the proxies?
share|improve this question
This sounds like a very bad idea, simply because of it's sheer complexity in maintenance. And, what happens when (!) one component breaks - will this break everything? Will you have resources, time and money to maintain this? Will it scale? If the answer to these questions are No, then I suggest you find an easier route. My 2 cents... – Patrik Alienus Oct 9 '12 at 12:35

I think you're talking about chaining two reverse proxies together but that's just semantics.

I've implemented a reverse, rewriting proxy on Apache 2.2 - single proxy, not chained together as you're considering. It was pretty straight forward. I applied the proxy config right along side the rewrite config in the same VirtualHost and everything worked more or less like I expected.

I don't see why you couldn't put another on the remote end. You'll have created a sort of HTTP tunnel. It's an interesting idea. Not one, I'd be willing to try (I agree with @patrik-alienus). I'd probably investigate an SSH tunnel or VPN.

And, if IIS is the only option for one of the endpoints, that would be the end of the conversation as far as I'm concerned. But I haven't worked much with recent versions and wouldn't be any kind of authority on the matter.

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.