%3CLINGO-SUB%20id%3D%22lingo-sub-1076685%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1076685%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20CareHart%2C%3C%2FP%3E%0A%3CP%3EYou%20are%20absolutely%20correct%20in%20pointing%20out%20these%20things%20in%20your%20comment%20above%3A%3CBR%20%2F%3E-%20the%20old%20blog%20(which%20was%20on%20the%20MSDN%20blogs%20side)%20will%20sunset%20soon%2C%20so%20this%20is%20why%20this%20article%20has%20been%20transitioned%20here.%20Unfortunately%2C%20the%20comments%20section%20could%20not%20be%20switched%20over.%3CBR%20%2F%3E-%20I%20have%20also%20reviewed%20the%20section%20regarding%20the%20install%20requirements%2C%20so%20that%20it%20specifies%20outright%20that%20what%20you%20need%20to%20download%20and%20install%20is%20ARR%20rather%20than%20just%20URL%20Rewrite%20(so%20readers%20can%20now%20know%20what%20to%20expect).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20for%20being%20able%20to%20use%20IIS%20as%20a%20reverse%20proxy%20without%20ARR%2C%20there%20are%20several%20modules%20that%20do%20this%20for%20very%20specific%20purposes%2C%20but%20they%20are%20all%20third%20party%20modules.%20There%20is%20a%20module%20that%20will%20forward%20jsp%20requests%20to%20a%20Tomcat%20Application%20server%20for%20example.%3CBR%20%2F%3E-%20what%20you%20have%20to%20understand%20is%20that%20ARR%20is%20two%20pieces%20of%20technology%3A%3C%2FP%3E%0A%3CP%3E1)%20an%20HTTP%20Handler%20that%20will%20take%20and%20forward%20requests%20and%20read%20responses%20coming%20out%20of%20the%20backend%3CBR%20%2F%3E2)%20a%20UI%20component%20that%20is%20loaded%20inside%20the%20IIS%20manager%20console%20to%20allow%20you%20to%20edit%20the%20%3CRULES%3E%20configuration%20sections%20in%20the%20web.config%20in%20an%20easy%20and%20graphical%20way.%3C%2FRULES%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20could%20argue%20that%20you%20could%20build%20your%20own%20managed%20handler%20to%20achieve%20the%20same%2C%20however%20ARR%20is%20written%20in%20native%20code%20and%20will%20thus%20outperform%20any%20managed%20handler%20we%20could%20write.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-975416%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-975416%22%20slang%3D%22en-US%22%3E%3CP%3EFWIW%2C%20I'll%20note%20for%20readers%20here%20that%20while%20this%20post%20is%20shown%20here%20with%20a%20Sep%202019%20date%2C%20the%20content%20is%20actually%20a%20re-post%20of%20the%20author's%20original%20blog%20entry%20from%202016%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Ffriis%2F2016%2F08%2F25%2Fsetup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fblogs.msdn.microsoft.com%2Ffriis%2F2016%2F08%2F25%2Fsetup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps%2F%3C%2FA%3E.%20And%20though%20the%20comments%20on%20that%20one%20are%20closed%2C%20there%20are%20some%20useful%20ones%20(from%20others%20and%20the%20author)%20which%20readers%20here%20may%20want%20to%20note.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20as%20we%20CAN%20comment%20here%2C%20I%20would%20like%20to%20ask%20the%20author%2C%20Paul%3A%20why%20did%20you%20not%20take%20the%20chance%20to%20revise%20this%20post%20to%20clarify%20how%20one%20needs%20to%20install%20ARR%20for%20this%20to%20work%3F%26nbsp%3B%20Anyone%20proceeding%20to%20the%20step%20to%20click%20on%2Fadd%20the%20%22reverse%20proxy%22%20rule%20will%20be%20prompted%20that%20they%20must%20install%20ARR%20first.%26nbsp%3B%20You%20hadn't%20indicated%20this%20in%20the%20first%20article%20(or%20the%20next%203%20parts)%2C%20but%20you%20did%20acknowledge%20it%20in%20later%20comments.%20Is%20it%20perhaps%20that%20when%20you%20wrote%20the%20article%2C%20you%20had%20ARR%20installed%20and%20so%20didn't%20notice%20this%20as%20a%20requirement%3F%20That%20would%20be%20understandable.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20it%20would%20be%20helpful%20for%20people%20to%20know%20of%20this%20requirement%2Fprerequisite%2C%20when%20reading%20this%20post%20(and%20the%20older%20version%20of%20it).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESome%20may%20argue%2C%20%22since%20IIS%20tells%20you%2C%20why%20should%20the%20article%20bother%3F%22%20But%20the%20point%20is%20that%20some%20will%20read%20the%20article%20(perhaps%20on%20a%20mobile%20device)%20and%20later%20go%20back%20to%20try%20it%20(to%20tell%20others%20that%20%22it's%20possible%22)%2C%20only%20to%20find%20this%20new%2C%20unexpected%20requirement.%20Perhaps%20they%20are%20not%20in%20a%20position%20to%20install%20new%20software%2C%20or%20they%20may%20worry%20that%20ARR%20is%20a%20large%20addition%20to%20IIS%20that%20could%20change%20its%20behavior%20in%20other%20ways.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20just%20pointing%20all%20this%20out%20for%20the%20sake%20of%20other%20readers%20who%20find%20it%2C%20but%20I%20would%20plead%20with%20Paul%20to%20consider%20adding%20mention%20of%20the%20AR%20requirement%20in%20the%20article%2C%20either%20near%20the%20top%20or%20at%20that%20point%20where%20the%20prompt%20would%20appear%20for%20those%20who%20don't%20have%20it%20installed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%2C%20%3CSTRONG%3Eif%20anyone%20may%20know%20of%20a%20solution%20for%20IIS%20that%20enables%20simple%20reverse%20proxy%20capabilities%20(%3CU%3Ewithout%20requiring%20ARR%3C%2FU%3E)%2C%20I'd%20love%20to%20hear%20of%20that%3C%2FSTRONG%3E.%20And%20I'd%20be%20ok%20if%20it%20was%20an%20add-on.%20Again%20one%20may%20wonder%2C%20%22then%20why%20not%20accept%20ARR%20as%20the%20needed%20add-on%3F%22%2C%20but%20the%20point%20is%20that%20that%20does%20a%20lot%20MORE%20than%20just%20add%20reverse%20proxy%20capability.%20If%20some%20add-on%20did%20just%20that%2C%20I%20and%20others%20may%20consider%20it%20first%20over%20having%20to%20go%20the%20ARR%20route.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20that%20said%2C%20thanks%2C%20Paul%2C%20for%20the%20effort%20on%20this%20and%20the%20other%20parts%20of%20the%20article%20series.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1083483%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1083483%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20reply%2C%20Paul.%20And%20thanks%20very%20much%20for%20updating%20the%20post%20to%20offer%20that%20additional%20clarification%20(and%20more).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20for%20the%20alternatives%20that%20could%20offer%20reverse%20proxy%20without%20ARR%2C%20I%20appreciate%20that%20you%20mention%20there%20are%20some%2C%20but%20%3CSTRONG%3Eagain%20I%20would%20love%20to%20hear%20from%20you%20or%20anyone%20offering%20more%20about%20those%3C%2FSTRONG%3E.%20I%20have%20tried%20to%20find%20them%20before%20with%20no%20success.%20I%20did%20say%20I%20didn't%20mind%20if%20they%20are%203rd-party%20add-ons.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20it's%20not%20that%20I%20am%20anti-ARR%2C%20but%20I%20fear%20that%20because%20it%20does%20much%20more%20than%20just%20setup%20reverse-proxying%2C%20it%20would%20be%20that%20some%20would%20either%20not%20want%20to%20or%20perhaps%20even%20not%20be%20allowed%20to%20enable%20it.%20And%20yes%2C%20I%20realize%20ARR%20%22is%22%20at%20least%20those%20two%20things%20you%20list%2C%20but%20it%20also%20adds%20still%20more%2C%20from%20load%20balancing%20to%20caching%2C%20and%20several%20more%20features%20listed%20at%20the%20bottom%20of%20that%20page.%20Again%20my%20concern%20is%20that%20someone%20may%20worry%20that%20adding%20such%20a%20toolbox%20when%20they%20want%20just%20a%20hammer%20may%20be%20overkill.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20instance%2C%20they%20may%20want%20simply%20one%20IIS%20instance%20(perhaps%20running%20as%20a%20Docker%20container)%20to%20proxy%20requests%20to%20just%20one%20backend%20server%20(perhaps%20also%20in%20Docker)%2C%20to%20avoid%20exposing%20that%20backend%20publicly.%20You%20mention%20Tomcat%2C%20and%20there%20is%20its%20AJP%20approach%20to%20connecting%20IIS%20to%20it.%20But%20Tomcat%20also%20offers%20its%20own%20web%20server.%20Someone%20may%20want%20to%20leverage%20IIS%20features%20to%20be%20the%20front-end%20for%20a%20site%2C%20but%20have%20those%20requests%20then%20processed%20by%20the%20backend%20Tomcat.%20That%20would%20be%20a%20perfect%20use%20case%20of%20enabling%20such%20a%20proxy.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20of%20course%20both%20Apache%20and%20nginx%20make%20it%20simple%2C%20but%20IIS%20does%20not.%20And%20adding%20ARR%20is%20overkill%20for%20that%20one%20need.%20So%20again%20if%20there%20is%20any%20alternative%20that%20would%20provide%20for%20this%2C%20I'd%20love%20to%20hear%20it.%20This%20URL%20Rewrite%20option%20of%20a%20%22reverse%20proxy%22%20rule%20was%20compelling%2C%20until%20I%20found%20everywhere%20that%20it%20was%20only%20offered%20if%20ARR%20was%20added.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20in%20case%20anyone%20may%20think%20it's%20just%20a%20technicality%20that%20the%20IIS%20UI%20only%20adds%20that%20rewrite%20option%20if%20ARR%20is%20installed%2C%20I%20can%20confirm%20that%20it%20will%20not%20work%20if%20you%20enable%20it%20via%20xml%2C%20such%20as%20in%20web.config%2C%20at%20least%20in%20trying%20to%20do%20a%20rewrite%20to%20a%20URL%20not%20processed%20by%20IIS%20itself%2C%20which%20again%20is%20my%20goal%20above.%20You%20will%20get%20errors%20indicating%20that%20IIS%20cannot%20process%20the%20request.%20Others%20have%20wanted%20to%20also%20do%20it%20(without%20respect%20to%20Docker)%20simply%20to%20have%20an%20IIS%20request%20be%20forwarded%20to%20some%20other%20back-end%20application%2C%20and%20they%20have%20encountered%20(and%20reported)%20the%20same%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-846222%22%20slang%3D%22en-US%22%3ESetup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-846222%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.iis.net%2Fdownloads%2Fmicrosoft%2Fapplication-request-routing%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EApplication%20Request%20Routing%3C%2FA%3E%2C%20one%20of%20the%20many%20modules%20that%20can%20be%20added%20on%20to%20the%20IIS%20web-server%20to%20make%20this%20a%20very%20versatile%20tool%20can%20be%20used%20to%20perform%20a%20variety%20of%20tasks%2C%20including%20allowing%20you%20to%20setup%20your%20IIS%20web-server%20as%20a%20reverse-proxy%20server%20to%20some%20other%20back-end%20HTTP%20service.%20A%20reverse%20proxy%20is%20a%20network%20device%20that%20takes%20in%20traffic%20coming%20from%20the%20Internet%20(for%20example)%2C%20and%20forwards%20this%20traffic%20to%20a%20backend%20server%20on%20your%20private%20network%2C%20allow%20that%20backend%20server%20to%20be%20accessible%20to%20people%20who%20are%20not%20necessarily%20connected%20to%20your%20network.%20There%20are%20a%20lot%20of%20articles%20on%20how%20to%20use%20IIS%20and%20URL%20Rewrite%20as%20a%20reverse%20proxy%2C%20but%20I%20have%20found%20that%20many%20are%20incomplete%20with%20regards%20to%20real%20world%20scenarios%20from%20today%E2%80%99s%20web%20applications.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EScenario%3A%20Setting%20up%20IIS%20with%20URL%20rewrite%20as%20a%20reverse%20proxy%20with%20SSL%20offloading%20for%20a%20backend%20service.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EDetails%3A%20suppose%20that%20we%20have%20a%20web-application%20hosted%20on%20one%20of%20our%20backend%20web-servers%2C%20IIS%20or%20another%20web%20server%2C%20and%20that%20this%20application%20server%20cannot%20be%20configured%20to%20use%20SSL%20and%20is%20not%20accessible%20to%20the%20end%20users%20because%20the%20end%20users%20do%20not%20have%20access%20to%20the%20network%20the%20server%20is%20on.%20We%20want%20IIS%20to%20perform%20the%20following%20tasks%3A%3C%2FP%3ETake%20in%20requests%20from%20the%20end%20users%20for%20content%20from%20this%20application%20using%20SSL%20Route%20these%20requests%20to%20the%20backend%20application%20server%20using%20HTTP%20Rewrite%20all%20responses%20from%20the%20backend%20server%2C%20so%20that%20any%20hyperlinks%2C%20form%20action%20tags%20and%20such%20are%20constructed%20with%20the%20URL%20that%20the%20IIS%20reverse%20proxy%20server%20has.%3CP%3EBelow%20is%20the%20diagram%20of%20the%20setup%20we%20wish%20to%20accomplish%20using%20IIS%20as%20a%20reverse%20proxy%20server%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20would%20like%20to%20take%20you%20through%20the%20configuration%20steps%20required%20to%20setup%20such%20a%20system%2C%20where%20requests%20are%20routed%20via%20the%20IIS%20server%20to%20the%20backend%20application%20server%20and%20the%20re-written%20back%20again%20with%20the%20public%20host-name%20of%20the%20IIS%20server%20and%20sent%20back%20to%20the%20connecting%20clients.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInstall%20Application%20Request%20Routing%20(ARR%20for%20short)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20step%20is%20to%20install%20the%20add-on%20module%20for%20Application%20Request%20Routing%20for%20IIS.%20With%20Windows%20Server%202012%20R2%20or%20later%20versions%20of%20Windows%20Server%202016%20and%202018%2C%20you%20can%20use%20the%20Microsoft%20Web%20Platform%20Installer%205.1%20(WebPI)%20to%20download%20and%20install%20the%20URL%20Rewrite%20Module.%20Just%20search%20for%20%E2%80%98URL%20Rewrite%E2%80%99%20in%20the%20search%20options%20and%20click%20%E2%80%98Add%E2%80%99.%20You%20can%20also%20download%20the%20extension%20from%20IIS.net%20-%20%3CA%20href%3D%22http%3A%2F%2Fwww.iis.net%2Fdownloads%2Fmicrosoft%2Furl-rewrite%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fwww.iis.net%2Fdownloads%2Fmicrosoft%2Fapplication-request-routing%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnce%20the%20module%20is%20installed%20in%20IIS%2C%20you%20will%20see%20a%20new%20Icon%20in%20the%20IIS%20Administration%20Console%2C%20called%20URL%20Rewrite%20-%20you%20may%20note%20that%20Url%20Rewrite%20is%20also%20an%20add-on%20that%20can%20be%20installed%20separately%2C%20but%20that%20ARR%20uses%20functionality%20provided%20by%20Url%20Rewrite%20to%20allow%20the%20server%20to%20act%20as%20a%20reverse%20proxy.%20This%20icon%20is%20present%20at%20the%20level%20or%20each%20site%20and%20web-application%20you%20have%20in%20the%20server%2C%20and%20will%20allow%20you%20to%20configure%20re-write%20rules%20that%20will%20apply%20from%20that%20level%20downwards.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESetup%20a%20Reverse%20Proxy%20rule%20using%20the%20Wizard.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOpen%20the%20IIS%20Manager%20Console%20and%20click%20on%20the%20Default%20Web%20Site%20from%20the%20tree%20view%20on%20the%20left.%20Select%20the%20URL%20Rewrite%20Icon%20from%20the%20middle%20pane%2C%20and%20then%20double%20click%20it%20to%20load%20the%20URL%20Rewrite%20interface.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChose%20the%20%E2%80%98Add%20Rule%E2%80%99%20action%20from%20the%20right%20pane%20of%20the%20management%20console%2C%20and%20the%20select%20the%20%E2%80%98Reverse%20Proxy%20Rule%E2%80%99%20from%20the%20%E2%80%98Inbound%20and%20Outbound%20Rules%E2%80%99%20category.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ENow%20we%20can%20proceed%20to%20fill%20in%20the%20routing%20information%20based%20on%20the%20diagram%20above%20in%20the%20Wizard%20window%20that%20is%20provided%20to%20us.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhile%20still%20in%20the%20same%20configuration%20window%2C%20we%20also%20need%20to%20provide%20information%20to%20take%20care%20of%20the%20responses%20that%20will%20be%20emitted%20by%20the%20backend%20server%20and%20will%20transit%20the%20IIS%20server%20on%20their%20way%20back%20to%20the%20requesting%20browser.%20These%20responses%20may%20have%20absolute%20hyperlinks%20inside%20and%20other%20information%20which%20contains%20the%20hostname%20of%20the%20backend%20server.%20If%20these%20are%20sent%20to%20the%20browser%20as%20is%2C%20the%20end%20user%20will%20not%20be%20able%20to%20access%20the%20resources%20these%20links%20point%20to%20simply%20because%20the%20browser%20does%20not%20know%20where%20http%3A%2F%2Fprivateserver%3A8080%2FHomePage.aspx%20is%20located%20and%20how%20it%20can%20be%20reached.%20We%20need%20to%20convert%20these%20into%20the%20hostname%20of%20the%20reverse%20proxy%20server%2C%20and%20have%20them%20look%20like%3A%20%3CA%20href%3D%22https%3A%2F%2Fwww.mypublicserver.com%2FHomePage.aspx%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fwww.mypublicserver.com%2FHomePage.aspx%3C%2FA%3E.%20For%20this%20reason%2C%20we%20will%20check%20the%20%E2%80%98Rewrite%20the%20domain%20names%20of%20the%20links%20in%20HTTP%20responses%E2%80%99%20checkbox%20in%20the%20Outbound%20Rules%20section.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThe%20basic%20setup%20for%20the%20reverse%20proxy%20is%20now%20complete%2C%20with%20IIS%20able%20to%20capture%20incoming%20traffic%20and%20forward%20it%20to%20the%20backend%20server%2C%20and%20inspect%20responses%20from%20the%20backend%20server%20and%20rewrite%20URL%20links%20inside%20the%20responses%20to%20match%20the%20host%20headers%20that%20IIS%20uses%20to%20publish%20the%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERead%20on%20in%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FIIS-Support-Blog%2FIIS-acting-as-reverse-proxy-Where-the-problems-start%2Fba-p%2F846259%23M344%22%20target%3D%22_blank%22%3Epart%20number%202%3C%2FA%3Eto%20see%20where%20the%20problems%20with%20this%20setup%20start.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-846222%22%20slang%3D%22en-US%22%3E%3CP%3ESuppose%20that%20we%20have%20a%20web-application%20hosted%20on%20one%20of%20our%20backend%20web-servers%2C%20IIS%20or%20another%20web%20server%2C%20and%20that%20this%20application%20server%20cannot%20be%20configured%20to%20use%20SSL%20and%20is%20not%20accessible%20to%20the%20end%20users%20because%20the%20end%20users%20do%20not%20have%20access%20to%20the%20network%20the%20server%20is%20on.%20This%20article%20series%20will%20show%20you%20how%20to%20configure%20an%20IIS%20server%20with%20url-rewrite%20to%20act%20as%20a%20reverse%20proxy%20and%20SSL%20offloading%20device%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1587755%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1587755%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20putting%20together%20a%20clear%20set%20of%20steps%20to%20create%20a%20reverse%20server%20proxy.%20We%20are%20in%20a%20situation%20where%20we%20need%20to%20create%20such%20a%20server.%20We%20have%20several%20legacy%20apps%20on%20a%20web%20server%20that%20we%20will%20have%20to%20keep%20running%20for%20some%20time.%20The%20webserver%20receives%20traffic%20from%20both%20internal%20and%20external%20users.%20My%20read%20is%20that%20the%20reverse%20proxy%20server%20doesn't%20care%20where%20the%20traffic%20comes%20from%2C%20only%20that%20it%20is%20addressed%20to%20the%20backend%20server%20it%20is%20set%20up%20to%20service.%20Once%20we%20set%20up%20the%20server%20and%20then%20repoint%20our%20DNS%20settings%20to%20direct%20web%20traffic%20to%20the%20reverse%20proxy%20server%20first%2C%20will%20it%20be%20able%20to%20deal%20with%20the%20traffic%20from%20both%20our%20private%20network%20and%20the%20internet%3F%26nbsp%3B%20%26nbsp%3BOur%20set%20up%20would%20be%26nbsp%3B%20Internet%20to%20RPS%20to%20Legacy%20and%20Private%20to%20RPS%20to%20Legacy.%20Is%20there%20any%20reason%20I%20am%20missing%20to%20cause%20this%20to%20fail%2C%20other%20than%20the%20usual%20vagaries%20of%20computers%20and%20networks%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1681737%22%20slang%3D%22en-US%22%3ERe%3A%20Setup%20IIS%20with%20URL%20Rewrite%20as%20a%20reverse%20proxy%20for%20real%20world%20apps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1681737%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20post.%20I%20have%20successfully%20tested%20this%20for%20couple%20of%20URLs%20hosted%20in%20the%20same%20server%20configuring%20the%20URL%20Rewrite.%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20when%20I%20opened%20the%20Application%20Request%20Routing%20properties%2C%20it%20shows%20me%20the%20following%20alerts.%20Is%20it%20Ok%20to%20leave%20it%20as%20is%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22iis-arr.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219422i5EB96F625139A2B9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22iis-arr.PNG%22%20alt%3D%22iis-arr.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Application Request Routing, one of the many modules that can be added on to the IIS web-server to make this a very versatile tool can be used to perform a variety of tasks, including allowing you to setup your IIS web-server as a reverse-proxy server to some other back-end HTTP service. A reverse proxy is a network device that takes in traffic coming from the Internet (for example), and forwards this traffic to a backend server on your private network, allow that backend server to be accessible to people who are not necessarily connected to your network. There are a lot of articles on how to use IIS and URL Rewrite as a reverse proxy, but I have found that many are incomplete with regards to real world scenarios from today’s web applications.

Scenario: Setting up IIS with URL rewrite as a reverse proxy with SSL offloading for a backend service.

Details: suppose that we have a web-application hosted on one of our backend web-servers, IIS or another web server, and that this application server cannot be configured to use SSL and is not accessible to the end users because the end users do not have access to the network the server is on. We want IIS to perform the following tasks:

  • Take in requests from the end users for content from this application using SSL
  • Route these requests to the backend application server using HTTP
  • Rewrite all responses from the backend server, so that any hyperlinks, form action tags and such are constructed with the URL that the IIS reverse proxy server has.

Below is the diagram of the setup we wish to accomplish using IIS as a reverse proxy server:

clipboard_image_1.png

I would like to take you through the configuration steps required to setup such a system, where requests are routed via the IIS server to the backend application server and the re-written back again with the public host-name of the IIS server and sent back to the connecting clients.

 

Install Application Request Routing (ARR for short)

 

The first step is to install the add-on module for Application Request Routing for IIS. With Windows Server 2012 R2 or later versions of Windows Server 2016 and 2018, you can use the Microsoft Web Platform Installer 5.1 (WebPI) to download and install the URL Rewrite Module. Just search for ‘URL Rewrite’ in the search options and click ‘Add’. You can also download the extension from IIS.net - https://www.iis.net/downloads/microsoft/application-request-routing.

 

image.png

 

Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console, called URL Rewrite - you may note that Url Rewrite is also an add-on that can be installed separately, but that ARR uses functionality provided by Url Rewrite to allow the server to act as a reverse proxy. This icon is present at the level or each site and web-application you have in the server, and will allow you to configure re-write rules that will apply from that level downwards.

 

Setup a Reverse Proxy rule using the Wizard.

 

Open the IIS Manager Console and click on the Default Web Site from the tree view on the left. Select the URL Rewrite Icon from the middle pane, and then double click it to load the URL Rewrite interface.

clipboard_image_3.png

 

Chose the ‘Add Rule’ action from the right pane of the management console, and the select the ‘Reverse Proxy Rule’ from the ‘Inbound and Outbound Rules’ category.

 

clipboard_image_4.png

 

clipboard_image_5.png

Now we can proceed to fill in the routing information based on the diagram above in the Wizard window that is provided to us.

 

While still in the same configuration window, we also need to provide information to take care of the responses that will be emitted by the backend server and will transit the IIS server on their way back to the requesting browser. These responses may have absolute hyperlinks inside and other information which contains the hostname of the backend server. If these are sent to the browser as is, the end user will not be able to access the resources these links point to simply because the browser does not know where http://privateserver:8080/HomePage.aspx is located and how it can be reached. We need to convert these into the hostname of the reverse proxy server, and have them look like: https://www.mypublicserver.com/HomePage.aspx. For this reason, we will check the ‘Rewrite the domain names of the links in HTTP responses’ checkbox in the Outbound Rules section.

 

clipboard_image_6.png

The basic setup for the reverse proxy is now complete, with IIS able to capture incoming traffic and forward it to the backend server, and inspect responses from the backend server and rewrite URL links inside the responses to match the host headers that IIS uses to publish the site.

 

Read on in part number 2 to see where the problems with this setup start.

 

5 Comments
Frequent Visitor

FWIW, I'll note for readers here that while this post is shown here with a Sep 2019 date, the content is actually a re-post of the author's original blog entry from 2016 at https://blogs.msdn.microsoft.com/friis/2016/08/25/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-.... And though the comments on that one are closed, there are some useful ones (from others and the author) which readers here may want to note.

 

And as we CAN comment here, I would like to ask the author, Paul: why did you not take the chance to revise this post to clarify how one needs to install ARR for this to work?  Anyone proceeding to the step to click on/add the "reverse proxy" rule will be prompted that they must install ARR first.  You hadn't indicated this in the first article (or the next 3 parts), but you did acknowledge it in later comments. Is it perhaps that when you wrote the article, you had ARR installed and so didn't notice this as a requirement? That would be understandable. 

 

But it would be helpful for people to know of this requirement/prerequisite, when reading this post (and the older version of it).

 

Some may argue, "since IIS tells you, why should the article bother?" But the point is that some will read the article (perhaps on a mobile device) and later go back to try it (to tell others that "it's possible"), only to find this new, unexpected requirement. Perhaps they are not in a position to install new software, or they may worry that ARR is a large addition to IIS that could change its behavior in other ways.

 

I'm just pointing all this out for the sake of other readers who find it, but I would plead with Paul to consider adding mention of the AR requirement in the article, either near the top or at that point where the prompt would appear for those who don't have it installed.

 

Finally, if anyone may know of a solution for IIS that enables simple reverse proxy capabilities (without requiring ARR), I'd love to hear of that. And I'd be ok if it was an add-on. Again one may wonder, "then why not accept ARR as the needed add-on?", but the point is that that does a lot MORE than just add reverse proxy capability. If some add-on did just that, I and others may consider it first over having to go the ARR route.

 

All that said, thanks, Paul, for the effort on this and the other parts of the article series.

Microsoft

Hello CareHart,

You are absolutely correct in pointing out these things in your comment above:
- the old blog (which was on the MSDN blogs side) will sunset soon, so this is why this article has been transitioned here. Unfortunately, the comments section could not be switched over.
- I have also reviewed the section regarding the install requirements, so that it specifies outright that what you need to download and install is ARR rather than just URL Rewrite (so readers can now know what to expect).

 

As for being able to use IIS as a reverse proxy without ARR, there are several modules that do this for very specific purposes, but they are all third party modules. There is a module that will forward jsp requests to a Tomcat Application server for example.
- what you have to understand is that ARR is two pieces of technology:

1) an HTTP Handler that will take and forward requests and read responses coming out of the backend
2) a UI component that is loaded inside the IIS manager console to allow you to edit the <rules> configuration sections in the web.config in an easy and graphical way.

 

You could argue that you could build your own managed handler to achieve the same, however ARR is written in native code and will thus outperform any managed handler we could write.

Frequent Visitor

Thanks for the reply, Paul. And thanks very much for updating the post to offer that additional clarification (and more).

 

As for the alternatives that could offer reverse proxy without ARR, I appreciate that you mention there are some, but again I would love to hear from you or anyone offering more about those. I have tried to find them before with no success. I did say I didn't mind if they are 3rd-party add-ons. :)

 

And it's not that I am anti-ARR, but I fear that because it does much more than just setup reverse-proxying, it would be that some would either not want to or perhaps even not be allowed to enable it. And yes, I realize ARR "is" at least those two things you list, but it also adds still more, from load balancing to caching, and several more features listed at the bottom of that page. Again my concern is that someone may worry that adding such a toolbox when they want just a hammer may be overkill.

 

For instance, they may want simply one IIS instance (perhaps running as a Docker container) to proxy requests to just one backend server (perhaps also in Docker), to avoid exposing that backend publicly. You mention Tomcat, and there is its AJP approach to connecting IIS to it. But Tomcat also offers its own web server. Someone may want to leverage IIS features to be the front-end for a site, but have those requests then processed by the backend Tomcat. That would be a perfect use case of enabling such a proxy. 

 

And of course both Apache and nginx make it simple, but IIS does not. And adding ARR is overkill for that one need. So again if there is any alternative that would provide for this, I'd love to hear it. This URL Rewrite option of a "reverse proxy" rule was compelling, until I found everywhere that it was only offered if ARR was added.

 

And in case anyone may think it's just a technicality that the IIS UI only adds that rewrite option if ARR is installed, I can confirm that it will not work if you enable it via xml, such as in web.config, at least in trying to do a rewrite to a URL not processed by IIS itself, which again is my goal above. You will get errors indicating that IIS cannot process the request. Others have wanted to also do it (without respect to Docker) simply to have an IIS request be forwarded to some other back-end application, and they have encountered (and reported) the same problem.

Occasional Visitor

Thank you for putting together a clear set of steps to create a reverse server proxy. We are in a situation where we need to create such a server. We have several legacy apps on a web server that we will have to keep running for some time. The webserver receives traffic from both internal and external users. My read is that the reverse proxy server doesn't care where the traffic comes from, only that it is addressed to the backend server it is set up to service. Once we set up the server and then repoint our DNS settings to direct web traffic to the reverse proxy server first, will it be able to deal with the traffic from both our private network and the internet?   Our set up would be  Internet to RPS to Legacy and Private to RPS to Legacy. Is there any reason I am missing to cause this to fail, other than the usual vagaries of computers and networks?

Occasional Visitor

Hi, 

Thanks for the post. I have successfully tested this for couple of URLs hosted in the same server configuring the URL Rewrite. 

However when I opened the Application Request Routing properties, it shows me the following alerts. Is it Ok to leave it as is? 

 

iis-arr.PNG