Anyone know how can set the $MAGE_RUN_CODE & $MAGE_RUN_TYPE variables for a Magento 2 multi site using ddev-local?
I have added the new domain to the additional_hostnames variable in .ddev/config.yaml – but now I need to tell the nginx docker container to serve the magento store front when that newstorefront.ddev.site domain is requested.
Any ideas? Thanks.
2
Answers
I have got this working by overriding the .ddev/nginx_full/nginx-site.conf and adding the following lines towards the top of the server block (just before where it defines
if ($mage_run_code = '') {
:Now it all works correctly.
Thanks
In ddev you can set environment variables globally or locally in the config, see https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#providing-custom-environment-variables-to-a-container
Basic idea: add this to your .ddev/config.yaml: