{"id":754,"date":"2021-01-31T00:16:40","date_gmt":"2021-01-31T00:16:40","guid":{"rendered":"http:\/\/bullyrooks.com\/?p=754"},"modified":"2021-01-31T00:16:40","modified_gmt":"2021-01-31T00:16:40","slug":"setting-up-a-reverse-proxy-with-synology","status":"publish","type":"post","link":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/31\/setting-up-a-reverse-proxy-with-synology\/","title":{"rendered":"Setting up a Reverse Proxy with Synology"},"content":{"rendered":"\n<p>Sometimes you want to be able to access your applications outside of your home network.  All of the applications that we setup in the <a href=\"https:\/\/bullyrooks.com\/index.php\/course\/media-server-appliations\/\" data-type=\"course\" data-id=\"17\">Installing Media Server Applications on Synology<\/a> series are currently only available if we&#8217;re on our network.  I&#8217;m going to discuss a few ways to make them available when you&#8217;re away from home.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Port Forwarding<\/h2>\n\n\n\n<p>This is probably the easiest method to setup but it has significant drawbacks.  With this method you create an external port and map it to an internal port (which is very similar to the port mapping we did for our docker applications).  Then if you know the IP address that your Internet Service Provider is presenting your modem as you can use that IP and the ports that you&#8217;ve mapped to access your home network.  <\/p>\n\n\n\n<p>The drawbacks are that remembering an IP address is kind of a pain.  Some ISPs change their external IP addresses occasionally, so you&#8217;ll have to change the IP address you use to access your network.  Also you&#8217;ll have to manage your port forwarding and potentially expose a lot of ports to the internet.  Every port you expose is like leaving a window or door unlocked in your house.<\/p>\n\n\n\n<p>There are services like <a href=\"https:\/\/www.noip.com\/support\/knowledgebase\/getting-started-with-no-ip-com\/\">no-ip<\/a> which will give you a DNS address that you can map to your IP which can reduce the effort of remembering IP addresses and use a easy to remember domain name, but you&#8217;ll still have to change out the IP address when your ISP changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run your own VPN<\/h2>\n\n\n\n<p>Now that you&#8217;ve got docker running you can find a docker image and run your own VPN which will let you &#8216;log on&#8217; to your home network externally.  This is probably the most secure solution, but it will involve a more complicated setup (which I&#8217;ll probably do as a separate course).  However, this does limit you to exposing your services to users who are more savvy.  For example, if I want to let family queue up movies to download or I want to do that from my phone away from home, we&#8217;ll need to install and configure VPN clients on those devices so that we can access the services inside the network.  I don&#8217;t want to spend my time playing tech support, so I wouldn&#8217;t use a VPN for this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reverse Proxy Server<\/h2>\n\n\n\n<p>A reverse proxy server allows me to open a single port (in this case port 80) and based on the request DNS coming in, forward that request to one of the services running in my instance.  In order for this to work, I will need a domain name.  These are cheap and easy to get and generally easy to configure.  This makes accessing the applications outside of your network extremely easy.  Plus having your own domain name really ups the nerd cred.  You&#8217;re running a network in your home, its time to step up!  Finally, synology comes with some really easy to use reverse proxy software, so it&#8217;s a challenge anyone can tackle and I&#8217;m here to show you how.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Get a Domain Name<\/h2>\n\n\n\n<p>I use <a href=\"https:\/\/www.hostinger.com\/domain-checker\">hostinger to buy and manage my domain names<\/a>.  Any one should work though.  The software has become super easy to use.  <\/p>\n\n\n\n<p>Once you have your domain name, you&#8217;ll need to create a single A name entry and a CNAME entry for each service you want to expose.<\/p>\n\n\n\n<p> First lookup your external ISP address <a href=\"https:\/\/whatismyipaddress.com\/\" data-type=\"URL\" data-id=\"https:\/\/whatismyipaddress.com\/\">here<\/a>.  Then in hostinger create an A entry that points to that.  Use a generic c level domain name because we&#8217;re not going to use it externally.  A c-level name in this example is <code>network<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"201\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-106.png?resize=856%2C201&#038;ssl=1\" alt=\"\" class=\"wp-image-755\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-106.png?w=856&amp;ssl=1 856w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-106.png?resize=300%2C70&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-106.png?resize=768%2C180&amp;ssl=1 768w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Now create a CNAME entry for the c level domain that you want to expose via the reverse proxy.  Examples would be <code>radarr<\/code>, <code>sonarr, portainer <\/code>(and possibly <code>plex<\/code>).  An example would look like this<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"198\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-107.png?resize=852%2C198&#038;ssl=1\" alt=\"\" class=\"wp-image-756\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-107.png?w=852&amp;ssl=1 852w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-107.png?resize=300%2C70&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-107.png?resize=768%2C178&amp;ssl=1 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Create all of the mappings that you want.  I would probably not expose SABnzbd or Transmission.  Sonarr and Radarr are the tools you can use to monitor your download applications.  Unless you&#8217;re planning to add items to download that aren&#8217;t shows or movies when you&#8217;re away from home you won&#8217;t need them.  Also, I&#8217;ve found the security for transmission to be a little difficult.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup the Reverse Proxy<\/h2>\n\n\n\n<p>Log into the Synology DSM, open the <code>Control Panel<\/code> and click <code>Advanced Mode<\/code> in the top right.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"535\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-108-1024x571.png?resize=960%2C535&#038;ssl=1\" alt=\"\" class=\"wp-image-757\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-108.png?resize=1024%2C571&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-108.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-108.png?resize=768%2C428&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-108.png?w=1210&amp;ssl=1 1210w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Open the <code>Application Portal<\/code>.  Choose the <code>Reverse Proxy<\/code> tab.  Click the create button.  Enter the configuration for one of your services.  Here&#8217;s the one I&#8217;m going to use for sonarr<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"597\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-110.png?resize=479%2C597&#038;ssl=1\" alt=\"\" class=\"wp-image-759\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-110.png?w=479&amp;ssl=1 479w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-110.png?resize=241%2C300&amp;ssl=1 241w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>This is going to take an https request for sonarr.bullyrooks.com and then forward the request to an http request to 192.168.1.147 port 31080 where my sonarr service is listening.  The reverse proxy works off of the hostname so a separate radarr entry will trigger the reverse proxy to redirect to a different host\/port.  Here&#8217;s my radarr config<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"481\" height=\"600\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-111.png?resize=481%2C600&#038;ssl=1\" alt=\"\" class=\"wp-image-760\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-111.png?w=481&amp;ssl=1 481w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-111.png?resize=241%2C300&amp;ssl=1 241w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Create entries for all of the services you want to expose.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Port Forwarding<\/h2>\n\n\n\n<p>We&#8217;ll need to open up some ports both to allow traffic in (SSL) and so that we can allow Let&#8217;s Encrypt to do its thing.  Open up ports for both external 443 and 80 tcp traffic to forward to 443 and 80 on the NAS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SSL<\/h2>\n\n\n\n<p>You noticed that we are using HTTPs (via the standard SSL port 443).  We&#8217;ll need to get a secure certificate to be able to support those requests.  We can generate the secure certificate request (CSR) and install the certificate for free and very easily with the built in synology software.<\/p>\n\n\n\n<p>Let&#8217;s Encrypt requires port 80 to be open to the world and forwarded to the NAS in order to work.  Make sure it is before moving forward.<\/p>\n\n\n\n<p>In control panel open the <code>Security <\/code>menu item and go to the <code>Certificate <\/code>tab.<\/p>\n\n\n\n<p>Click Add, choose Add a new certificate and hit next.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"550\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-112.png?resize=647%2C550&#038;ssl=1\" alt=\"\" class=\"wp-image-761\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-112.png?w=647&amp;ssl=1 647w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-112.png?resize=300%2C255&amp;ssl=1 300w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Choose Get a certificate from Let&#8217;s Encrypt and hit Next<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"547\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-113.png?resize=653%2C547&#038;ssl=1\" alt=\"\" class=\"wp-image-762\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-113.png?w=653&amp;ssl=1 653w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-113.png?resize=300%2C251&amp;ssl=1 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Enter your domain name, the email you used to register it and in subject alternative name, put all of the CNAME entries that you want to use.  These are semicolon separated<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-114.png?resize=580%2C53&#038;ssl=1\" alt=\"\" class=\"wp-image-763\" width=\"580\" height=\"53\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-114.png?w=928&amp;ssl=1 928w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-114.png?resize=300%2C28&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-114.png?resize=768%2C71&amp;ssl=1 768w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>so, <code>radarr.mydomain.com;sonarr.mydomain.com;portainer.mydomain.com<\/code><\/p>\n\n\n\n<p>and hit <code>Apply<\/code>.  <\/p>\n\n\n\n<p>Once you get your certificate, click on the domain to highlight it and click the <code>Configure<\/code> button.  In this next screen make sure that all of the c-level domain names are pointing to the correct certificate.<\/p>\n\n\n\n<p>That should be it.  You can now hit https:\/\/sonarr.mydomain.com to get to your service instance.  <strong>DEFINITELY<\/strong> <strong>MAKE SURE THAT YOUR SERVICES REQUIRE A USERNAME AND PASSWORD TO ACCESS.<\/strong>  You don&#8217;t want to find out that someone got access to your service and started downloading a bunch of stuff and filled up your NAS.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nSometimes you want to be able to access your applications outside of&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/bullyrooks.com\/index.php\/2021\/01\/31\/setting-up-a-reverse-proxy-with-synology\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Setting up a Reverse Proxy with Synology&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,36],"tags":[14,39,7,38,37,6],"course":[],"class_list":["post-754","post","type-post","status-publish","format-standard","hentry","category-home-networking","category-synology","tag-dns","tag-domain-name","tag-home-networking","tag-nas","tag-reverse-proxy-service","tag-synology","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":976,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/11\/synology-first-steps\/","url_meta":{"origin":754,"position":0},"title":"Synology First Steps","author":"Bullyrook","date":"February 11, 2021","format":false,"excerpt":"The applications and configuration you should setup first thing out of the box. Community Packages My page here explains how to integrate synology community packages into the Package center. Control Panel Advanced Mode In the top right corner of the Control Panel click Advanced Mode to allow you to see\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1001,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/setup-and-install-nextcloud-on-synology\/","url_meta":{"origin":754,"position":1},"title":"Setup and Install NextCloud On Synology","author":"Bullyrook","date":"February 21, 2021","format":false,"excerpt":"NextCloud is a file storage and sharing system. It can be compared to dropbox or google drive. The difference here is that you're using your NAS, so you'll get as much space as you can support without paying for additional storage. NextCloud also offers multi-platform compatibility via a web application\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":988,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/14\/synology-configuration-for-bitwarden\/","url_meta":{"origin":754,"position":2},"title":"Synology Configuration for Bitwarden","author":"Bullyrook","date":"February 14, 2021","format":false,"excerpt":"We need to do a few things to synology to allow access to bitwarden outside of our network. Add a Reverse Proxy Entry If you haven't set up the reverse proxy yet, follow the instructions here. My configuration looks like this You'll also need to add an entry in your\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/02\/image-56.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":703,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/28\/installing-jackett\/","url_meta":{"origin":754,"position":3},"title":"Installing Jackett","author":"Bullyrook","date":"January 28, 2021","format":false,"excerpt":"Jackett is a database for bittorrent indexers. This allows you to refer to internal resources when configuring radarr and sonarr, which then get mapped to external API. It makes it really easy to add more bittorrent indexers to expand the breadth of your searches. Running Jackett Container The docker project\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-79.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1003,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/02\/21\/nextcloud-configuration\/","url_meta":{"origin":754,"position":4},"title":"NextCloud Configuration","author":"Bullyrook","date":"February 21, 2021","format":false,"excerpt":"We'll need to do a few things before we can actually start using nextcloud. Edit config.php First stop the nextcloud containers (from the \/nextcloud directory) sudo docker-compose down Now change to the nextcloud configuration directory cd \/volume1\/docker\/nextcloud\/config\/ and use nano (or vi) to edit the config.php file sudo nano config.php\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/02\/image-62.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":733,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/01\/30\/configuring-radarr\/","url_meta":{"origin":754,"position":5},"title":"Configuring Radarr","author":"Bullyrook","date":"January 30, 2021","format":false,"excerpt":"We're almost there! Lets configure Radarr quickly so that we can download movies. General Configuration Settings\/Media Management. Click Show Advanced. Check Rename Movies. Hit Save Changes. Configure Indexers This is almost exactly the same as sonarr. I'm just going to cover this with screenshots. Sabnzbd Bittorrent Configure Download Clients Click\u2026","rel":"","context":"In &quot;Home Networking&quot;","block_context":{"text":"Home Networking","link":"https:\/\/bullyrooks.com\/index.php\/category\/technology\/home-networking\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-92.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-92.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/01\/image-92.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/comments?post=754"}],"version-history":[{"count":1,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/754\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/754\/revisions\/764"}],"wp:attachment":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/media?parent=754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/categories?post=754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/tags?post=754"},{"taxonomy":"course","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/course?post=754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}