{"id":221,"date":"2018-08-22T10:35:17","date_gmt":"2018-08-21T22:35:17","guid":{"rendered":"https:\/\/www.berserkir.net\/wordpress\/?p=221"},"modified":"2019-03-29T10:16:26","modified_gmt":"2019-03-28T22:16:26","slug":"reverse-proxy-with-iis","status":"publish","type":"post","link":"https:\/\/www.berserkir.net\/wordpress\/reverse-proxy-with-iis\/","title":{"rendered":"Reverse Proxy (with IIS)"},"content":{"rendered":"<p>I run a lot of different pieces of software on my server. Sonarr, Radarr, Lidarr&#8230; just to name a few.<br \/>\nAll of these different systems listen on different ports, and I got tired of having so many ports forwarded and so many different ports to remember.<\/p>\n<p>Enter: Reverse Proxy.<\/p>\n<p><!--more--><\/p>\n<p>First: what is it?<\/p>\n<p>A reverse proxy allows you to pass traffic from one thing to another transparently in the background.<br \/>\nWhat this means is that I can have an application listening on a different port to my webserver, and have my web server silently pass traffic across to that application. From a user viewpoint, it&#8217;s just a website over https (that nice green secure site rating). Much nicer.<\/p>\n<p>Second: how do I use it?<\/p>\n<p>Pretty easily, as it happens.<br \/>\nFirst, I need to install a few components for IIS &#8211; namely <a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\">URL Rewrite<\/a> and <a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/application-request-routing\">Application Request Routing<\/a>. I used the <a href=\"https:\/\/www.microsoft.com\/web\/downloads\/platform.aspx\">Web Platform Installer<\/a> to do this bit.<\/p>\n<p>After that, I set up the base site in IIS. It&#8217;s listening on ports 80 and 443 (http and https). I created subdirectores from the site folder (\/sonarr, \/radarr, \/lidarr, \/mylarr etc).<br \/>\nI then set each application to use the subdirectory as a &#8216;baseurl&#8217;, so that they reply nicely. Mylar listened on localhost:6767\/mylar once the baseurl was set, for example.<br \/>\nI created a proxy rule in each &#8216;sub&#8217; path, to match the application it was going to be for. url\/radarr passes content to localhost:7878\/radarr, url\/sonarr to localhost:8989\/sonarr, and so on.<br \/>\nWith that set, I restarted IIS to apply the changes, and&#8230; voil\u00e0! I have SSL via the base site in IIS, and don&#8217;t have to remember the individual ports for each application.<\/p>\n<div id=\"attachment_230\" style=\"width: 722px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-230\" class=\"size-full wp-image-230\" src=\"https:\/\/www.berserkir.net\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-23-17_03_24-Window.png\" alt=\"\" width=\"722\" height=\"502\" srcset=\"https:\/\/www.berserkir.net\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-23-17_03_24-Window.png 722w, https:\/\/www.berserkir.net\/wordpress\/wp-content\/uploads\/2018\/08\/2018-08-23-17_03_24-Window-300x209.png 300w\" sizes=\"auto, (max-width: 722px) 100vw, 722px\" \/><p id=\"caption-attachment-230\" class=\"wp-caption-text\">This is the web.config file for redirecting url\/mylar to the mylar application<\/p><\/div>\n<p>Third: why bother?<\/p>\n<p>Anyone running Radarr\/Sonarr\/Lidarr\/Mylar etc has probably input the wrong port for the application at some point. I did many times. I also got tired of having to forward so many different ports for my system to work nicely; and every now and then the firewall at work would complain about weird ports trying to pass http traffic. Now? No more firewall complaints, because it&#8217;s https traffic over the standard https port. I don&#8217;t have to port forward, or remember the individual ports. I go to site\/service, and it silently passes my query from there to the relevant application listening in the background.<\/p>\n<p>The result?<br \/>\nA happy me!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I run a lot of different pieces of software on my server. Sonarr, Radarr, Lidarr&#8230; just to name a few. All of these different systems listen on different ports, and I got tired of having so many ports forwarded and so many different ports to remember. Enter: Reverse Proxy.<\/p><p><a class=\"more-link btn\" href=\"https:\/\/www.berserkir.net\/wordpress\/reverse-proxy-with-iis\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,51,41,16,78],"tags":[57,55,52,3,56,53,13,26,54,45,48],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-helpful-hints","category-iis","category-servers","category-software","category-web-systems","tag-access","tag-baseurl","tag-iis","tag-microsoft","tag-ports","tag-reverse-proxy","tag-server","tag-software","tag-url-rewrite","tag-useful","tag-web-page","item-wrap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":6,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/posts\/221\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.berserkir.net\/wordpress\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}