Skip to content

Adds multistore parameter - #109

Open
LouisdeLooze wants to merge 2 commits into
qoliber:mainfrom
LouisdeLooze:feature/add-multi-store-parameter
Open

LouisdeLooze wants to merge 2 commits into
qoliber:mainfrom
LouisdeLooze:feature/add-multi-store-parameter

Conversation

@LouisdeLooze

@LouisdeLooze LouisdeLooze commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #107

This is a limited breaking change. The proposed default for multi_store is false, meaning $MAGE_RUN_CODE and $MAGE_RUN_TYPE will be omitted from Nginx config by default going forward. Users with existing multi-store projects will need to explicitly add multi_store: true to their project YAML to preserve the previous behaviour.

@jakwinkler

Copy link
Copy Markdown
Contributor

@Aquive is that PR related to magebox failing the code for multistore if the main store code is not default?

@Aquive

Aquive commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@jakwinkler this is not my PR. Its from @LouisdeLooze I haven't digged into this.

@LouisdeLooze

Copy link
Copy Markdown
Contributor Author

I updated the PR to follow the idea mentioned: #107 (comment)

@jakwinkler jakwinkler self-assigned this Sep 22, 2026
jakwinkler pushed a commit that referenced this pull request Sep 28, 2026
Magento resolved a store by code even for single-store projects, because
MageBox always injected MAGE_RUN_CODE and MAGE_RUN_TYPE. A host map now
sets them only for domains that name a store code, which also supports
store and website mode in one project and removes two optional settings.

Closes #107
jakwinkler added a commit that referenced this pull request Sep 28, 2026
Follow-up to #109, which is otherwise ready.

The map was written per project into the shared vhosts directory. nginx
accepts one map per variable and includes every file in that directory
into the same http block, so a second multistore project would have made
it reject the whole configuration with `duplicate "MAGE_RUN_CODE"
variable` and serve nothing at all. All projects now share one file,
rebuilt from every project when any of them starts, and per-project files
from an earlier build are removed.

Hosts are matched exactly. With a leading dot in nginx's `hostnames`
mode, a deliberately code-less admin.mystore.test inherited the code of
mystore.test, which the PR's own test expected not to happen.

mage_run_code and mage_run_type keep working with a deprecation warning.
The loader ignores unknown keys, so renaming them outright would have let
existing multistore projects lose their codes silently and serve the
wrong store.

A store_type other than store or website now fails validation instead of
reaching Magento as a value it does not understand.

Docs: the domain properties table, the --store-type flag, the FAQ answer
that promised MAGE_RUN_CODE=default, and how the shared map works.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

Add multi_store YAML option to conditionally omit $MAGE_RUN_CODE / $MAGE_RUN_TYPE from Nginx config

3 participants