Magento – Configure Nginx to single MAGENTO instance for running multiple stores (domains)

multistorenginx

I'm trying to run multi-store environment (2 websites) on single Magento instance but I can't figure it out. Looking around the net for solutions, I tried everything but it doesn't work.

The main website works fine but on the second one, I got this warning:

/var/www/vhosts/mydomain2.com/httpdocs/app/Mage.php was not found

I have Plesk + NGINX + PHP-FPM

I tried to setup multiple IP in one network card like this tutorial:
http://blog.sina.com.cn/s/blog_dbc356910101blfg.html

But with no success.

I always got this message:

/var/www/vhosts/mydomain2.com/httpdocs/app/Mage.php was not found

Your assistance is greatly appreciated.

Best Answer

at http{ } block:

map $request_uri $MAGE_RUN_CODE {
    default   en;
    ~^/fi/     fi;
}

map $request_uri $MAGE_RUN_TYPE {
    default   store;
    ~^/fi/     store;
}

at php${ } block:

fastcgi_param   MAGE_RUN_CODE $MAGE_RUN_CODE;
fastcgi_param   MAGE_RUN_TYPE $MAGE_RUN_TYPE;
Related Topic