{"id":16439,"date":"2026-03-08T14:26:00","date_gmt":"2026-03-08T20:26:00","guid":{"rendered":"https:\/\/macblaze.ca\/?p=16439"},"modified":"2026-03-31T11:09:42","modified_gmt":"2026-03-31T17:09:42","slug":"nginx-notes","status":"publish","type":"post","link":"https:\/\/macblaze.ca\/?p=16439","title":{"rendered":"Nginx Notes"},"content":{"rendered":"<p>Way back in https:\/\/macblaze.ca\/?p=14445 I set up Nginx to\u00a0 handle port forwarding to my home computer. Since then I have modified it a bot and I wanted to make a not of those mods here.<\/p>\n<h2>Site in a subfolder<\/h2>\n<ul>\n<li>I have the subdomain <strong>xxx.macblaze.ca<\/strong>.<\/li>\n<li>I want to have it access a site at <strong>192.168.1.xx:8080<\/strong><\/li>\n<li>in a folder <strong>\/folder<\/strong><\/li>\n<\/ul>\n<p>Set up the subdomain as usual<\/p>\n<ol>\n<li>go to Custom Locations<\/li>\n<li>location <code>\/<\/code><\/li>\n<li>Forward Hostname\/IP <code>192.168.1.xx\/folder<\/code><\/li>\n<li>Forward Port <code>8080<\/code><\/li>\n<\/ol>\n<h2>Docker container<\/h2>\n<ul>\n<li>ensure the container and Nginx&#8217;s container are on the same network. (current code method)<\/li>\n<\/ul>\n<p>Set up the subdomain as usual<\/p>\n<ol>\n<li>go to Details<\/li>\n<li>Forward Hostname\/IP <code>&lt;container-name&gt;<\/code> (get using <code>docker ps --format \"{{.Names}}\"<\/code>)<br \/>\nor Container IP<\/li>\n<li>Forward Port <code>&lt;the internal port&gt;<\/code><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>Two Sites\/Apps on one subdomain<\/h2>\n<ul>\n<li>I have the subdomain <strong>xxx.macblaze.ca<\/strong>.<\/li>\n<li>I want to have it access a site at <strong>192.168.1.xx1:8080<\/strong><\/li>\n<li>I want the subdomain <strong>xxx.macblaze.ca\/app<\/strong> to access an app at <strong>192.168.1.xx2:8080<\/strong><\/li>\n<\/ul>\n<p>Set up<\/p>\n<ol>\n<li>the subdomain as usual for the site<\/li>\n<li>go to Advanced Locations<\/li>\n<li>Add:\n<pre>location \/app {\n    proxy_pass http:\/\/192.168.1.xx2:8080\/;\n}\nlocation \/app\/ {\n    proxy_pass http:\/\/192.168.1.xx2:8080\/;\n}<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Way back in https:\/\/macblaze.ca\/?p=14445 I set up Nginx to\u00a0 handle port forwarding to my home computer. Since then I have modified it a bot and I wanted to make a not of those mods here. Site in a subfolder I have the subdomain xxx.macblaze.ca. I want to have it access a site at 192.168.1.xx:8080 in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/16439"}],"collection":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16439"}],"version-history":[{"count":2,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/16439\/revisions"}],"predecessor-version":[{"id":16446,"href":"https:\/\/macblaze.ca\/index.php?rest_route=\/wp\/v2\/posts\/16439\/revisions\/16446"}],"wp:attachment":[{"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macblaze.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}