Skip to content

feature: allow a configurable backend address - #112

Open
mj0nez wants to merge 3 commits into
codebude:mainfrom
mj0nez:feature/allow-configurable-backend-address
Open

mj0nez wants to merge 3 commits into
codebude:mainfrom
mj0nez:feature/allow-configurable-backend-address

Conversation

@mj0nez

@mj0nez mj0nez commented Oct 15, 2026

Copy link
Copy Markdown

This PR migrates the Nginx config to a template which allows now the configuration of the backend address, which is necessary if one want changes the compose service or uses a different deployment method / networking stack.

This enables setups which do deviate from the default docker-compose and it's networking config.
@codebude codebude changed the title feature: allow a configurable backend addresse feature: allow a configurable backend address Oct 15, 2026
@codebude

Copy link
Copy Markdown
Owner

Thanks for your PR. The idea is right: the hardcoded backend:8000 locks the image to one Compose network and service name, which rules out Kubernetes, Portainer and similar setups. Four things before merge, all small:

  1. BACKEND_ADDR needs a default. Unset, envsubst leaves the placeholder in and nginx won't start: nginx: [emerg] unknown "backend_addr" variable. Our compose files are updated so the documented path is fine, but anyone pulling the ghcr image directly (k8s, Portainer, own compose, Helm) breaks at container start. A one-liner in frontend/Dockerfile fixes it without losing the configurability:

    ENV BACKEND_ADDR=http://backend:8000

    Tested both ways: unset renders the default and nginx -t passes, set still overrides it.

  2. Worth a "no trailing slash" note in the docs. proxy_pass treats the slash as a URI part and strips the location prefix, so http://backend:8000/ sends /api/books upstream as /books. nginx starts fine, which makes it look like a backend bug.

  3. Compose: ${BACKEND_ADDR:-http://backend:8000} instead of a literal, matching the ${VAR:-default} pattern already used in these files. Then the upstream can be set from .env instead of editing the compose file, which is closer to the point of the PR.

  4. docs/releases.md needs an small entry/update

Happy to re-review when these are in.

@codebude codebude added the enhancement New feature or request label Oct 15, 2026

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants