{"id":6206,"date":"2021-07-19T22:52:03","date_gmt":"2021-07-20T02:52:03","guid":{"rendered":"https:\/\/peroty.com\/blog\/?p=6206"},"modified":"2021-07-19T22:52:08","modified_gmt":"2021-07-20T02:52:08","slug":"cleaner-nginx-proxy-configs","status":"publish","type":"post","link":"https:\/\/peroty.com\/blog\/tinkered-with\/cleaner-nginx-proxy-configs\/","title":{"rendered":"Cleaner nginx proxy configs"},"content":{"rendered":"\n<p>I&#8217;ve been slowly teaching myself self-hosting things over the past few years. I&#8217;ve got a decent variety of things running at home. But I find it frustrating to keep track of their IPs and ports so I setup a reverve proxy which is a fancy term for <em>one little linux container on my network directs you to everything else.&nbsp;<\/em>Now I can hit plex.domain.tld, or wiki.domain.tld and get to where I want to go.<\/p>\n\n\n\n<p>I had all of these setup with their own individual config files were very short. Most of them were little more than:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># A small thing running on a raspberry pi\n\nserver {\nlisten 80;\nserver_name pi.domain.tld\n\nlocation \/ {\nproxy_pass http:\/\/192.168.0.99:80;\n}\n}<\/code><\/pre>\n\n\n\n<p>I know there&#8217;s an easier way. And tonight I found a post that laid it all out and it clicked for me.<\/p>\n\n\n\n<p>Timothy Quinn&#8217;s <a href=\"https:\/\/timothy-quinn.com\/using-nginx-as-a-reverse-proxy-for-multiple-sites\">Using Nginx as a Reverse Proxy for Multiple Sites<\/a> laid it all out and I realized all I needed to do was add all of my little config files to one big file. And I add a comment to the front of\u00a0 each config to remind myself what it was and anything important to remember. This worked great for my Tiddlywiki, RSS reader, Calibre-web and Bookstack instance I have running.<\/p>\n\n\n\n<p>His example is for sites with SSL enabled which I&#8217;m not going to move tonight. But I replicated this for all of my sites not running SSL. My next task is to move the SSL-enabled ones. But I run Nextcloud for myself and my wife so I need to take more time and make sure I do that right since it&#8217;s as close to a &#8220;production&#8221; thing that I self-host. So if it&#8217;s down, it affects more than just me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been slowly teaching myself self-hosting things over the past few years. I&#8217;ve got a decent variety of things running at home. But I find it frustrating to keep track of their IPs and ports so I setup a reverve proxy which is a fancy term for one little linux container on my network directs [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1415],"tags":[1411,1439,1440],"class_list":["post-6206","post","type-post","status-publish","format-standard","hentry","category-tinkered-with","tag-homelab","tag-nginx","tag-reverse-proxy"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/posts\/6206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/comments?post=6206"}],"version-history":[{"count":1,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/posts\/6206\/revisions"}],"predecessor-version":[{"id":6207,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/posts\/6206\/revisions\/6207"}],"wp:attachment":[{"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/media?parent=6206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/categories?post=6206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peroty.com\/blog\/wp-json\/wp\/v2\/tags?post=6206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}