Test environment: WINDOWS10, iis/10.0
1. Install arr, url Rewrite (URL rewrite tool 2.0)
Note the correspondence between English and Chinese environment:
Application request Routing for Chinese application demand routing
URL Rewrite Module corresponds to Chinese URL rewrite
Download Install arr (you can also search for "arr" in the search box in IIS Manager, Web Platform Installer, products--), Application Request Routing 3.0 beta-> Add, install): http://www.iis.net/ Downloads/microsoft/application-request-routing
Download Install URL Rewrite Module (you can also search for "url" in the Search box in IIS Manager, products--, web Platform installer,->url Rewrite tool 2.0-> Add):/http www.microsoft.com/en-us/download/details.aspx?id=7435
When the above installation is complete and reopen IIS Manager, you can see the following
2. Enable arr: Double click arr (Application Request Routing), click on the right server Proxy settings...-> select Enabel proxy-> click on the right "app"
3. Enable URL rewriting, which can be configured via Web. config or through interface settings (Web. config can eventually be viewed and manipulated using the interface ), such as the Web. config sample,
At this time Www.che.com/che or www.che.com/che/xxxx are agents to www.proxy.com or www.proxy.com/xxx, if you do not want to filter out "Che", only need to change the match url "^ (che (/?|. *))$"
<?XML version= "1.0" encoding= "UTF-8"?><Configuration> <system.webserver> <rewrite> <rules> <Rulename= "Cheproxy"stopprocessing= "true"> <MatchURL= "^che" (/?|. *)$" /> <conditions> <Addinput= "{http_host}"pattern= "Www\.che\.com" /> </conditions> <Actiontype= "Rewrite"URL= "Http://www.proxy.com{r:1}" /> <ServerVariables> <Setname= "Http_x_forwarded_host"value= "{http_host}" /> </ServerVariables> </Rule> </rules> </rewrite> </system.webserver></Configuration>
Due to the use of variable http_x_forwarded_host, you need to add http_x_forwarded_host, add-on, view server variables, URL rewriting
iis-Reverse Proxy