Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I setup reverse proxy on IIS, allowing cross-host communciation between host1.mydomain.com and host2.mydomain.com?

I have a page at host1.mydomain.com/page_from_host1.jsp and an HTML page at host2.mydomain.com/page_from_host2.html. host1 is an IIS7/Tomcat box and host2 is an IIS7 box. I want to allow the first page to submit a form, which displays the second page, and the URL does not change.

That is, the URL is host1.mydomain.com/page_rom_host2.jsp, but the contents of the page are from host2.mydomain.com/page_from_host2.html.

I would imagine I can setup a reverse proxy on IIS to accomplish this, similar to mod_proxy, but the Apache Tomcat Server throws a bit of a wrench into all of this. How can I setup a reverse proxy to allow cross-host communication and mask the URL?

Thank you.

like image 513
user717236 Avatar asked Apr 03 '12 18:04

user717236


2 Answers

FYI the URL seemed to move here:

http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

Here's the basic gist:

Install these two things:

  • Application Request Routing
  • Url Rewrite Module

Configure "Application Request Routing"

  • IIS server node -> Application Request Routing Cache
  • Server Proxy Settings
  • Check "Enable Proxy"

Then one can configure URL rewriting module as needed.

like image 82
Michael Ferrante Avatar answered Oct 26 '22 23:10

Michael Ferrante


By using following C# code "Enable Proxy" can be checked/enabled

ServerManager servMgr = new ServerManager();
Configuration config = servMgr.GetApplicationHostConfiguration();
ConfigurationSection proxySection = config.GetSection("system.webServer/proxy");
proxySection["enabled"] = true;
servMgr.CommitChanges();
like image 41
Murari Kumar Avatar answered Oct 27 '22 00:10

Murari Kumar