{"id":599,"date":"2024-03-15T22:31:49","date_gmt":"2024-03-15T22:31:49","guid":{"rendered":"https:\/\/wp-yoda.com\/en\/?p=599"},"modified":"2024-03-16T09:15:17","modified_gmt":"2024-03-16T09:15:17","slug":"how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy","status":"publish","type":"post","link":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/","title":{"rendered":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy"},"content":{"rendered":"\n<p>You might have had to run two or more Docker projects on a local machine at some point. This is a common task for developers if you have multiple projects or you are using a microservices architecture.<\/p>\n\n\n\n<p>However, working with multiple Docker projects, you might have encountered some issues:<\/p>\n\n\n\n<ul class=\"wp-block-list\" style=\"margin-top:var(--wp--preset--spacing--20);margin-bottom:var(--wp--preset--spacing--20)\">\n<li>Containers (nginx\/apache) from different projects can conflict because they all try to use the standard HTTP port (80 or 443 for HTTPS). Only one container can listen to a port at a time.<\/li>\n\n\n\n<li>Difficulties with external integrations or with the project itself can arise if it is not on port 80\/443. For example, you might need to access it via <code>http:\/\/wp-yoda.local:8080\/<\/code>. <br>In these cases, changes may need to be made to the project&#8217;s code for it to work correctly or to coordinate with the support team.<\/li>\n\n\n\n<li>A WordPress Multisite setup will not run on any port other than 80\/443, meaning you can&#8217;t run more than 2 WordPress Multisite instances locally on Docker. <\/li>\n<\/ul>\n\n\n\n<p>The solution to these problems is the use of a <a href=\"https:\/\/github.com\/renakdup\/localreverseproxy\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">local Reverse Proxy<\/a>, which allows receiving requests on port 80 and redirecting them to the corresponding Docker containers running on different ports. This not only solves the port conflict issue but also enables the use of custom local URLs for accessing projects without additional problems, adding convenience to the workflow.<\/p>\n\n\n\n<p>In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.<\/p>\n\n\n  \r\n    \r\n<div id=\"wpj-jtoc\" class=\"wpj-jtoc wpj-jtoc--main --jtoc-the-content --jtoc-theme-basic-light --jtoc-title-align-left --jtoc-toggle-icon --jtoc-toggle-position-right --jtoc-toggle-1 --jtoc-has-numeration --jtoc-numeration-legacy --jtoc-has-custom-styles --jtoc-is-unfolded --jtoc-align-left\" >\r\n  <!-- TOC -->\r\n        <div class=\"wpj-jtoc--toc wpj-jtoc--toc-inline \" >\r\n              <div class=\"wpj-jtoc--header\">\r\n        <div class=\"wpj-jtoc--header-main\">\r\n                    <div class=\"wpj-jtoc--title\">\r\n                        <span class=\"wpj-jtoc--title-label\">Table of contents<\/span>\r\n          <\/div>\r\n                                <div class=\"wpj-jtoc--toggle-wrap\">\r\n                                                          <div class=\"wpj-jtoc--toggle-box\">\r\n                  <div class=\"wpj-jtoc--toggle\"><\/div>\r\n                <\/div>\r\n                          <\/div>\r\n                  <\/div>\r\n      <\/div>\r\n            <div class=\"wpj-jtoc--body\">\r\n            <nav class=\"wpj-jtoc--nav\">\r\n        <ol class=\"wpj-jtoc--items\"><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content --jtoc-h2\" data-depth=\"2\">\r\n                                                <a href=\"#how-is-it-work\"  title=\"How is it work\" data-numeration=\"1\">How is it work<\/a>\r\n                    <\/div><ol class=\"wpj-jtoc--items\"><li class=\"wpj-jtoc--item --jtoc-h3\">\r\n        <div class=\"wpj-jtoc--item-content --jtoc-h3\" data-depth=\"3\">\r\n                                                <a href=\"#from-request-to-response\"  title=\"From \u2018request\u2019 to \u2018response\u2019\" data-numeration=\"1.1\">From \u2018request\u2019 to \u2018response\u2019<\/a>\r\n                    <\/div><\/li><\/ol><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content --jtoc-h2\" data-depth=\"2\">\r\n                                                <a href=\"#step-by-step-guide-on-setting-up-and-running-a-local-reverse-proxy\"  title=\"Step-by-Step Guide on Setting Up and Running a Local Reverse Proxy\" data-numeration=\"2\">Step-by-Step Guide on Setting Up and Running a Local Reverse Proxy<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content --jtoc-h2\" data-depth=\"2\">\r\n                                                <a href=\"#practical-application\"  title=\"Practical application\" data-numeration=\"3\">Practical application<\/a>\r\n                    <\/div><\/li><li class=\"wpj-jtoc--item --jtoc-h2\">\r\n        <div class=\"wpj-jtoc--item-content --jtoc-h2\" data-depth=\"2\">\r\n                                                <a href=\"#the-helpful-links\"  title=\"The helpful links\" data-numeration=\"4\">The helpful links<\/a>\r\n                    <\/div><\/li><\/ol>      <\/nav>\r\n          <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\n\n\n<h2 class=\"wp-block-heading\">How is it work<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-9-1024x237.png\" alt=\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - diagram.\" class=\"wp-image-3078\"\/><figcaption class=\"wp-element-caption\">The diagram of how Local Reverse Proxy works.<\/figcaption><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Client is you.<\/li>\n\n\n\n<li><code>hosts<\/code> file is a file that contains all the desired local domains, which should be directed to the IP address 127.0.0.1. <em>Your local DNS<\/em>.<\/li>\n\n\n\n<li>Reverse Proxy listens on port <code>80<\/code> and proxies requests to Docker containers based on specific rules, which are described in <code>services.json<\/code> (more on this later).<\/li>\n\n\n\n<li>Target Server (Docker App) &#8211; this is our Docker project. There can be multiple such projects, as many as you need to run simultaneously.<br><strong>The main task is to specify different ports for different Docker projects in Apache or Nginx.<\/strong><\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite><strong>About ports:<\/strong><br>In the context of computer networks, if one process (container) is &#8220;listening&#8221; to or receiving data on a specific port, another process cannot use the same port on the same interface for listening or receiving data. This prevents conflicts and ensures that data intended for a particular application or service is correctly routed to it.<\/cite><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote has-highlight-light-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite>0.1.1 version of Local Reverse Proxy works only on port 80, 443 port is not supported on this version.<\/cite><\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">From &#8216;request&#8217; to &#8216;response&#8217;<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>When you enter a request in the browser, such as <code>http:\/\/example.local<\/code>, the OS routing initially finds the domain&#8217;s corresponding IP in the <code>\/etc\/hosts<\/code> file.<\/li>\n\n\n\n<li>Then, a request is made to this IP &#8211; <code>127.0.0.1<\/code> and port <code>80<\/code> with the domain <code>example.local<\/code> in the header.<\/li>\n\n\n\n<li>Port 80 is already being listened to by our Reverse Proxy, and it receives this request.<\/li>\n\n\n\n<li>Next, the Local Reverse Proxy extracts the domain from the request and searches for it in the <code>services.json<\/code> file, which contains an object with a list of domains and where to proxy them:\n<ul class=\"wp-block-list\">\n<li><code>\"Domain\": \"Address to a docker container\"<\/code><\/li>\n\n\n\n<li><code>\"example.local\": \"http:\/\/localhost:8080\"<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n{\n  &quot;pbnwp.loc&quot;: &quot;http:\/\/localhost:8080&quot;,\n  &quot;*.local&quot;: &quot;http:\/\/localhost:8090&quot;\n}\n<\/pre><\/div>\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite>You can also use wildcards, such as <code>*.local<\/code>. This would mean to proxy all requests to <code>*.local<\/code> domains to the <code>http:\/\/localhost:8090<\/code> container.<\/cite><\/blockquote>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li>And our Docker application, which, for example, has Nginx exposed on port <code>8080<\/code>, receives this request from our Local Reverse Proxy at <code>http:\/\/localhost:8080<\/code>. <em>Inside, the container thinks it&#8217;s operating on port 80.<\/em><\/li>\n\n\n\n<li>After that, the Docker application handles the request and sends a response to the Local Reverse Proxy.<\/li>\n\n\n\n<li>Local Reverse Proxy in turn returns the response to a client.<\/li>\n<\/ol>\n\n\n\n<p>Your main task will be to configure an external port for nginx\/apache in your Docker project that is different from 80 and does not conflict with the port of another Docker project. You can use ports such as 8080, 8090, etc.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step-by-Step Guide on Setting Up and Running a Local Reverse Proxy<\/strong><\/h2>\n\n\n\n<p>For a step-by-step guide on how to launch and configure a local Reverse Proxy, including the full steps for setting up Local Reverse Proxy and Docker projects, you can refer to the project&#8217;s <a href=\"https:\/\/github.com\/renakdup\/localreverseproxy\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GitHub repository<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Practical application<\/h2>\n\n\n\n<p>In our projects, we use this solution in the team to work with two Docker projects under port 80 simultaneously, without additional configurations and script rewrites.<\/p>\n\n\n\n<p>Among the conveniences: we no longer need to stop one Docker project and start another to check something on the other project. This, in turn, has reduced the number of errors during development and increased comfort when working with projects. There&#8217;s no need to remember which ports the projects are on, as they are now always directly accessible by domain. Also, we connect a 3rd Docker project when we need to run a microservice.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-highlight-light-background-color has-background is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite>Among the significant advantages, it&#8217;s worth noting that to add a new domain, you don&#8217;t need to recompile the application. It&#8217;s enough to simply add a new domain in <code>services.json<\/code>, as well as in the <code>hosts<\/code> file, and you can immediately start making requests. This is possible because the <code>services.json<\/code> file is read at runtime.<\/cite><\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite>You can also use Nginx as a local Reverse Proxy. However, it will require configuration and restarting, which in our case turned out to be inconvenient.<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">The helpful links<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/renakdup\/localreverseproxy\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">The Local Reverse Proxy Github repository<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/11349039\/cannot-install-wordpress-multisite-network-on-a-custom-port\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Cannot install WordPress Multisite (Network) on a custom port<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.<\/p>\n","protected":false},"author":1,"featured_media":601,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,48],"tags":[47],"class_list":["post-599","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-environment","category-go","tag-go"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda<\/title>\n<meta name=\"description\" content=\"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda\" \/>\n<meta property=\"og:description\" content=\"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Yoda\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T22:31:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-16T09:15:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1263\" \/>\n\t<meta property=\"og:image:height\" content=\"719\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/\"},\"author\":{\"name\":\"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#\\\/schema\\\/person\\\/195c797aee113d174e07e4887a9fe464\"},\"headline\":\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy\",\"datePublished\":\"2024-03-15T22:31:49+00:00\",\"dateModified\":\"2024-03-16T09:15:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/\"},\"wordCount\":921,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wp-yoda.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/image-6.png\",\"keywords\":[\"Go\"],\"articleSection\":[\"Environment\",\"GO\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/\",\"url\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/\",\"name\":\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wp-yoda.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/image-6.png\",\"datePublished\":\"2024-03-15T22:31:49+00:00\",\"dateModified\":\"2024-03-16T09:15:17+00:00\",\"description\":\"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wp-yoda.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/image-6.png\",\"contentUrl\":\"https:\\\/\\\/wp-yoda.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/image-6.png\",\"width\":1263,\"height\":719,\"caption\":\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/environment\\\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/\",\"name\":\"WP Yoda\",\"description\":\"Notes about PHP, WordPress and IT\",\"publisher\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#organization\",\"name\":\"WP Yoda\",\"url\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/05\\\/Andrew_222_Master_Yoda__WordPress_plain_background_763a84a4-5042-4fac-9bdb-4562c05563e7.png\",\"contentUrl\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/05\\\/Andrew_222_Master_Yoda__WordPress_plain_background_763a84a4-5042-4fac-9bdb-4562c05563e7.png\",\"width\":1024,\"height\":1024,\"caption\":\"WP Yoda\"},\"image\":{\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/#\\\/schema\\\/person\\\/195c797aee113d174e07e4887a9fe464\",\"name\":\"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g\",\"caption\":\"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439\"},\"sameAs\":[\"https:\\\/\\\/wp-yoda.com\"],\"url\":\"https:\\\/\\\/wp-yoda.com\\\/en\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda","description":"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/","og_locale":"en_US","og_type":"article","og_title":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda","og_description":"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.","og_url":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/","og_site_name":"WP Yoda","article_published_time":"2024-03-15T22:31:49+00:00","article_modified_time":"2024-03-16T09:15:17+00:00","og_image":[{"width":1263,"height":719,"url":"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png","type":"image\/png"}],"author":"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#article","isPartOf":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/"},"author":{"name":"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439","@id":"https:\/\/wp-yoda.com\/en\/#\/schema\/person\/195c797aee113d174e07e4887a9fe464"},"headline":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy","datePublished":"2024-03-15T22:31:49+00:00","dateModified":"2024-03-16T09:15:17+00:00","mainEntityOfPage":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/"},"wordCount":921,"commentCount":0,"publisher":{"@id":"https:\/\/wp-yoda.com\/en\/#organization"},"image":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png","keywords":["Go"],"articleSection":["Environment","GO"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/","url":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/","name":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy - WP Yoda","isPartOf":{"@id":"https:\/\/wp-yoda.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#primaryimage"},"image":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png","datePublished":"2024-03-15T22:31:49+00:00","dateModified":"2024-03-16T09:15:17+00:00","description":"In this article, I will explore how a local Reverse Proxy in Go, which I wrote to handle two or more Docker projects on port 80, works. You will learn how to easily and efficiently manage access to multiple containers using a single standard port, and how to eliminate the need for additional configuration of each project to work in such an environment.","breadcrumb":{"@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#primaryimage","url":"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png","contentUrl":"https:\/\/wp-yoda.com\/wp-content\/uploads\/2024\/03\/image-6.png","width":1263,"height":719,"caption":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy"},{"@type":"BreadcrumbList","@id":"https:\/\/wp-yoda.com\/en\/environment\/how-to-run-multiple-docker-projects-under-port-80-using-an-off-the-shelf-local-reverse-proxy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wp-yoda.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to run multiple Docker projects under port 80 using an off-the-shelf local Reverse Proxy"}]},{"@type":"WebSite","@id":"https:\/\/wp-yoda.com\/en\/#website","url":"https:\/\/wp-yoda.com\/en\/","name":"WP Yoda","description":"Notes about PHP, WordPress and IT","publisher":{"@id":"https:\/\/wp-yoda.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wp-yoda.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wp-yoda.com\/en\/#organization","name":"WP Yoda","url":"https:\/\/wp-yoda.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wp-yoda.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/wp-yoda.com\/en\/wp-content\/uploads\/sites\/2\/2023\/05\/Andrew_222_Master_Yoda__WordPress_plain_background_763a84a4-5042-4fac-9bdb-4562c05563e7.png","contentUrl":"https:\/\/wp-yoda.com\/en\/wp-content\/uploads\/sites\/2\/2023\/05\/Andrew_222_Master_Yoda__WordPress_plain_background_763a84a4-5042-4fac-9bdb-4562c05563e7.png","width":1024,"height":1024,"caption":"WP Yoda"},"image":{"@id":"https:\/\/wp-yoda.com\/en\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/wp-yoda.com\/en\/#\/schema\/person\/195c797aee113d174e07e4887a9fe464","name":"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d3f11053e005f02e0dc3049c010b45034646963c7af8edac8076c3767022d750?s=96&r=g","caption":"\u0410\u043d\u0434\u0440\u0435\u0439 \u041f\u0438\u0441\u0430\u0440\u0435\u0432\u0441\u043a\u0438\u0439"},"sameAs":["https:\/\/wp-yoda.com"],"url":"https:\/\/wp-yoda.com\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/posts\/599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/comments?post=599"}],"version-history":[{"count":0,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/posts\/599\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/media\/601"}],"wp:attachment":[{"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/media?parent=599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/categories?post=599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-yoda.com\/en\/wp-json\/wp\/v2\/tags?post=599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}