<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="256942" data-post-id="256942">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Exadra37" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Exadra37/120/9183_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Exadra37
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="11" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>st reaching plug would need to have the prefix to be processed.</p>
</blockquote>
</aside>
<p>So, you mean to add to <code>url</code> in <code>runtime.exs</code> the following:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :api_baas, ApiBaasWeb.Endpoint,
    url: [host: apibaas.io/myapp, port: 443, scheme: "https"],
</code></pre>
<p>If this works I was not aware, and that’s solves the problem really well.</p>
<hr>
<p>I totally forgot about this old proof of concept of mine:</p>
<p><a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md</a></p>
<p>In this PoC you can also find <a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md#phoenix-360-web-apps-routing-dispatch" rel="noopener nofollow ugc">this approach</a> to handle this path situation:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># file: ./phoenix360/config/runtime.exs

config :phoenix360, Phoenix360Web.Endpoint,
  http: [
    port: phoenix360_http_port,
    transport_options: [socket_opts: [:inet6]],
    # @link https://ninenines.eu/docs/en/cowboy/2.7/guide/routing/
    dispatch: [
      {
        phoenix360_host,
        [
          # @PHOENIX_360_WEB_APPS - Each included 360 web app needs to have an
          #   endpoint in the top level 360 web app. This is necessary in order
          #   for the top level 360 web app to know how to dispatch the requests.
          #   For example a request to app.local/_links/* will be dispatched to
          #   the `/links/*` endpoint for the LinksWeb.Router.
          #
          # {:path_match, :handler, :initial_state}
          {"/_links/[...]", Phoenix.Endpoint.Cowboy2Handler, {LinksWeb.Endpoint, []}},
          {"/_notes/[...]", Phoenix.Endpoint.Cowboy2Handler, {NotesWeb.Endpoint, []}},

          # @PHOENIX_360_WEB_APPS - This tells that all other request must be
          #   dispatched to the Phoenix360Web.Router, aka the one for the top
          #   level 360 web app.
          {:_, Phoenix.Endpoint.Cowboy2Handler, {Phoenix360Web.Endpoint, []}},
        ]
      },
      {
        links_host,
        [
          # {:path_match, :handler, :initial_state}
          {:_, Phoenix.Endpoint.Cowboy2Handler, {LinksWeb.Endpoint, []}},
        ]
      },
      {
        notes_host,
        [
          # {:path_match, :handler, :initial_state}
          {:_, Phoenix.Endpoint.Cowboy2Handler, {NotesWeb.Endpoint, []}},
        ]
      }
    ]
  ]

# @PHOENIX_360_WEB_APPS - No need to have a server running for `:links`, because
#    the requests will be handled by the Cowboy server for the main 360 web app
#    `phoenix360`:
config :links, LinksWeb.Endpoint,
  server: false

# @PHOENIX_360_WEB_APPS - No need to have a server running for `:notes`, because
#    the requests will be handled by the Cowboy server for the main 360 web app
#    `phoenix360`:
config :notes, NotesWeb.Endpoint,
  server: false
</code></pre>
<p>The project contains a full step by step to reproduce a working example.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="256942" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-256942" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="256942"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="257137" data-post-id="257137">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="rogerweb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rogerweb/120/22010_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  rogerweb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="9" data-topic="49203" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>Don’t do that. all you need to do are:</p>
<ul>
<li>change the <code>url</code> key of your Endpoint config with a non-root url.</li>
<li>change the js for the lv or socket url if you use channel or liveview. I usually add a data attribute in my <code>&lt;body&gt;</code> tag to pass the correct url (derived from above) to the client side</li>
</ul>
</blockquote>
</aside>
<p>Unfortunately that’s not all we need to do. To demonstrate it, one can do:</p>
<ol>
<li>Start fresh with <code>mix phx.new hello --no-ecto</code></li>
<li>Apply your first point, i.e., add the path to the Endpoint:</li>
</ol>
<pre data-code-wrap="elixir"><code class="lang-elixir"># runtime.exs
  config :hello, HelloWeb.Endpoint,
    url: [host: host, port: 443, scheme: "https", path: "/myapp"],
</code></pre>
<ol start="3">
<li>Apply your second point:</li>
</ol>
<pre data-code-wrap="javascript"><code class="lang-javascript">// app.js
let liveSocket = new LiveSocket("/myapp/live", Socket, {params: {_csrf_token: csrfToken}})
</code></pre>
<ol start="4">
<li>
<p>Start the application with <code>mix phx.server</code></p>
</li>
<li>
<p>Access <a href="http://localhost:4000/myapp" rel="noopener nofollow ugc">http://localhost:4000/myapp</a></p>
</li>
<li>
<p>Observe that you got a 404 not found.</p>
</li>
</ol>
<p>This is not a surprise as the Endpoint’s <a href="https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-runtime-configuration" rel="noopener nofollow ugc">documentation</a> tells us the <code>url</code> config is about how URLs are <strong>generated</strong>, it is not the base path/prefix/scope for all the routes in your app.</p>
<p>So this config won’t make your routes to be found, unless you manually prefix them with <code>/myapp</code>. As per previous posts, this was not an option because the prefix is a runtime/deployment concern, but I temporarily accepted it as a workaround just to move on. So now the page and assets (and sockets added via <code>mix phx.gen.socket</code> and manually prefixed) are found, great, but not the live reload frame (<a href="http://localhost:4000/myapp/phoenix/live_reload/frame" rel="noopener nofollow ugc">http://localhost:4000/myapp/phoenix/live_reload/frame</a>). And for that, it seems there is no config to be changed.</p>
<p>Also, Phoenix’s dashboard generates URLs with a duplicated <code>/myapp</code>, like <a href="http://localhost:4000/myapp/myapp/dashboard/home" rel="noopener nofollow ugc">http://localhost:4000/myapp/myapp/dashboard/home</a></p>
<aside class="quote no-group" data-username="derek-zhou" data-post="11" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>I am not sure about AWS ALB, but this is how multiple phoenix apps work behind a single nginx reverse proxy.</p>
</blockquote>
</aside>
<p>That’s why I told you</p>
<aside class="quote no-group" data-username="rogerweb" data-post="10" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rogerweb/48/22010_2.png" class="avatar"> rogerweb:</div>
<blockquote>
<p>I understand your suggestion is the standard approach when the load balancer can re-write the URL, which unfortunately is not the case</p>
</blockquote>
</aside>
<p>Because</p>
<aside class="quote no-group" data-username="rogerweb" data-post="1" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/rogerweb/48/22010_2.png" class="avatar"> rogerweb:</div>
<blockquote>
<p>The problem is that ALB doesn’t support stripping this <code>/myapp</code> prefix from the actual URL that goes to Phoenix (differently from nginx, haproxy, etc)</p>
</blockquote>
</aside> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257137" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-257137" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257137"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="257164" data-post-id="257164">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="derek-zhou" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/120/19943_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  derek-zhou
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see. IMHO you have 2 choices:</p>
<ul>
<li>make myapp part of your official route</li>
<li>install a sane reverse proxy such as nginx in front of your app</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257164" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-257164" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257164"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="257167" data-post-id="257167">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Exadra37" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Exadra37/120/9183_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Exadra37
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="14" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<ul>
<li>make myapp part of your official route</li>
<li>install a sane reverse proxy such as nginx in front of your app</li>
</ul>
</blockquote>
</aside>
<p>The solution I present in the proof of concept I linked above can also be used, and it was inspired in an Elixir proxy repo I found on my research at the time.</p>
<p>Replace below <code>/_links/</code> with <code>/myapp</code> and remove <code>/_notes</code> an it should work for you, provided that you also follow the other bits in the step-by-step on the repo.</p>
<aside class="quote no-group" data-username="Exadra37" data-post="12" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/48/9183_2.png" class="avatar"> Exadra37:</div>
<blockquote>
<p>In this PoC you can also find <a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md#phoenix-360-web-apps-routing-dispatch" rel="noopener nofollow ugc">this approach</a> to handle this path situation:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># file: ./phoenix360/config/runtime.exs

config :phoenix360, Phoenix360Web.Endpoint,
  http: [
    port: phoenix360_http_port,
    transport_options: [socket_opts: [:inet6]],
    # @link https://ninenines.eu/docs/en/cowboy/2.7/guide/routing/
    dispatch: [
      {
        phoenix360_host,
        [
          # @PHOENIX_360_WEB_APPS - Each included 360 web app needs to have an
          #   endpoint in the top level 360 web app. This is necessary in order
          #   for the top level 360 web app to know how to dispatch the requests.
          #   For example a request to app.local/_links/* will be dispatched to
          #   the `/links/*` endpoint for the LinksWeb.Router.
          #
          # {:path_match, :handler, :initial_state}
          {"/_links/[...]", Phoenix.Endpoint.Cowboy2Handler, {LinksWeb.Endpoint, []}},
          {"/_notes/[...]", Phoenix.Endpoint.Cowboy2Handler, {NotesWeb.Endpoint, []}},

          # @PHOENIX_360_WEB_APPS - This tells that all other request must be
          #   dispatched to the Phoenix360Web.Router, aka the one for the top
          #   level 360 web app.
          {:_, Phoenix.Endpoint.Cowboy2Handler, {Phoenix360Web.Endpoint, []}},
        ]
      },
      {
        links_host,
        [
          # {:path_match, :handler, :initial_state}
          {:_, Phoenix.Endpoint.Cowboy2Handler, {LinksWeb.Endpoint, []}},
        ]
      },
      {
        notes_host,
        [
          # {:path_match, :handler, :initial_state}
          {:_, Phoenix.Endpoint.Cowboy2Handler, {NotesWeb.Endpoint, []}},
        ]
      }
    ]
  ]

# @PHOENIX_360_WEB_APPS - No need to have a server running for `:links`, because
#    the requests will be handled by the Cowboy server for the main 360 web app
#    `phoenix360`:
config :links, LinksWeb.Endpoint,
  server: false

# @PHOENIX_360_WEB_APPS - No need to have a server running for `:notes`, because
#    the requests will be handled by the Cowboy server for the main 360 web app
#    `phoenix360`:
config :notes, NotesWeb.Endpoint,
  server: false
</code></pre>
</blockquote>
</aside> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257167" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-257167" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257167"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="257324" data-post-id="257324">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Exadra37" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Exadra37/120/9183_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Exadra37
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="Exadra37" data-post="12" data-topic="49203">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/48/9183_2.png" class="avatar"> Exadra37:</div>
<blockquote>
<p><a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md" class="inline-onebox" rel="noopener nofollow ugc">elixir-phoenix-360-web-apps/TRY_IT_OUT.md at dev_runtime-wip · Exadra37/elixir-phoenix-360-web-apps · GitHub</a></p>
<p>In this PoC you can also find <a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip/TRY_IT_OUT.md#phoenix-360-web-apps-routing-dispatch" rel="noopener nofollow ugc">this approach</a> to handle this path situation:</p>
</blockquote>
</aside>
<p>I have updated the Github repo with a more recent branch that I only had in Gitlab.:</p>
<p><a href="https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip2/TRY_IT_OUT.md#endpoint-session-configuration-security" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/Exadra37/elixir-phoenix-360-web-apps/blob/dev_runtime-wip2/TRY_IT_OUT.md#endpoint-session-configuration-security</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="257324" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-257324" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="257324"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="284533" data-post-id="284533">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aherranz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aherranz/120/12892_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aherranz
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Great discussion. Just if this helps:</p>
<p>My context:</p>
<ul>
<li>In production I have my phoenix app dockerized and running behind a reverse proxy (nginx) configured on url “<a href="http://example.com/myapp" rel="noopener nofollow ugc">example.com/myapp</a>”.</li>
<li>I want the app to be run in dev mode, deployed in production mode but also in production mode dockerized in my laptop (just to check everything will be working properly when deployed).</li>
<li>My final decision is to inject in the <code>app.js</code> the path (<code>"/myapp"</code> when deployed, <code>"/"</code> when dockerized in my laptop and <code>nil</code> in dev mode), the injection is done as the CSFR token is injected:</li>
</ul>
<pre data-code-wrap="javascript"><code class="lang-javascript">let liveSocketPath = document.querySelector("meta[name='live-socket-path']")?.getAttribute("content") || "/live"
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket(liveSocketPath, Socket, {params: {_csrf_token: csrfToken}})
</code></pre>
<p>Then, data is extracted from the environment in the layout:</p>
<pre data-code-wrap="html"><code class="lang-html">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
    &lt;meta name="live-socket-path" content={Application.get_env(:myapp, :phx_path)} /&gt;
    &lt;meta name="csrf-token" content={get_csrf_token()} /&gt;
...
</code></pre>
<ul>
<li><code>phx_path</code> is a key in my configuration files, not defined in <code>dev.ex</code> and loaded from the system environment in <code>runtime.ex</code></li>
</ul>
<p>What do you think about the solution?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="284533" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-284533" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="284533"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="284579" data-post-id="284579">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aherranz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aherranz/120/12892_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aherranz
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I found a better solution using the function <code>MyAppWeb.Endpoint.path/1</code> to avoid introducing a new config entry:</p>
<pre data-code-wrap="html"><code class="lang-html">    &lt;meta name="live-socket-path" content={MyAppWeb.Endpoint.path "/live"} /&gt;
</code></pre>
<p>And let JS fail of the meta data is not defined:</p>
<pre data-code-wrap="javascript"><code class="lang-javascript">let liveSocketPath = document.querySelector("meta[name='live-socket-path']").getAttribute("content");
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="284579" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-application-behind-aws-alb/49203/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-284579" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="284579"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>