I have a Magento installation with multiple websites, which is running in Apache web server. Now I want to move these to Nginx web server; how can I achieve this with Nginx configuration? Below is the htaccess code which is redirecting websites:
SetEnvIf HOST 44\.55\.222\.101\:8080 MAGE_RUN_CODE=website_new
SetEnvIf HOST 44\.55\.222\.101\:8080 MAGE_RUN_TYPE=website
Please help.
.htaccess
andSetEnvIf
is for Apache web server. For Nginx you can usefastcgi_param
(if you are running nginx with fastcgi).You can find more details here: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
To run 2 Magento websites on the same server with different ports you bave to use 2 different nginx configuration files for each port under
/etc/nginx/conf.d/
.From the example provided it seems like you are running the websites on ports 80 and 8080. The Magento has provided the default nginx configuration here at http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
Use this for port 80 and for 8080 use the below code:
Store code is defined in Administration > Configuration > Manage Stores