How to conditionally set enviroment variable

Lasse Pommerenke lasse.pommerenke at dailydeal.de
Mon Nov 22 17:34:40 MSK 2010


Moin!

To make use of Magento's multistore feature I need to tell it which
store to load. This is done wih an environemnt variable.

Is there a way to make something like this work in "server" context:

if ($host ~* \.(at|ch|de)v?$) {
    env MAGE_RUN_CODE=storeview_$1;
}

ATM it seems I cannot use 'env' in "server" context, and in a hight
context I cannot use 'if'.



More information about the nginx mailing list