Skip to content

Fix endpoint port config in an umbrella application.#6549

Merged
SteffenDE merged 2 commits intophoenixframework:mainfrom
khustochka:fix-runtime-exs-for-umbrella
Dec 8, 2025
Merged

Fix endpoint port config in an umbrella application.#6549
SteffenDE merged 2 commits intophoenixframework:mainfrom
khustochka:fix-runtime-exs-for-umbrella

Conversation

@khustochka
Copy link
Copy Markdown
Contributor

@khustochka khustochka commented Nov 29, 2025

TLDR: This PR fixes endpoint port configuration in runtime.exs in a newly generated umbrella application. This is a regression introduced in Phoenix 1.8.2.

I have noticed that with upgrade to Phoenix 1.8.2 port configuration has been moved to runtime.exs and new lines have been added (#6449). I checked what's changed for an umbrella application (on phoenixdiff) and these are the lines that are added:

config :sample_app, SampleAppWeb.Endpoint,
  http: [port: String.to_integer(System.get_env("PORT", "4000"))]

while everywhere else, even in the very same file, SampleAppWeb.Endpoint is configured on sample_app_web, not sample_app.

Steps to reproduce:

  1. Create a new umbrella application on Phoenix 1.8.2. Install all dependencies.
mix phx.new test182 --umbrella
  1. Switch to the app
cd test182_umbrella
  1. Start the app with alternative port
PORT=4500 iex -S mix phx.server

Observe the output.

Actual:

[info] Running Test182Web.Endpoint with Bandit 1.8.0 at 127.0.0.1:4000 (http)
[info] Access Test182Web.Endpoint at http://localhost

As we see, the custom port is not obeyed, and the endpoint URL is missing the port altogether.

Expected:

[info] Running Test182Web.Endpoint with Bandit 1.8.0 at 127.0.0.1:4500 (http)
[info] Access Test182Web.Endpoint at http://localhost:4500

@khustochka khustochka changed the title Correctly configure endpoint port in an umbrella application. Fix endpoint port config in an umbrella application. Dec 1, 2025
@SteffenDE SteffenDE merged commit 9c3e921 into phoenixframework:main Dec 8, 2025
@SteffenDE
Copy link
Copy Markdown
Contributor

🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants