Using Nginx 1.4.6 on Ubuntu, i'm trying to configure Magento 2 to run in a subfolder.
I already have some others projets in /var/www, that are set up like so:
server {
server_name website.com;
root /var/www/;
location /p1/ {
# config
}
location /p2/ {
# config
}
}
But now, my Magento installation is located at /mnt/storage/demo/demo-magento2 and I can't find a way to include it in this server block.
I tried to use their sample configuration for Nginx (https://github.com/magento/magento2/wiki/Nginx-Configuration-Settings-and-Environment-Variables). So, I added this location block to my server block configuration:
location /demos/demo-magento2/ {
set $MAGE_ROOT /mnt/storage/demo-magento2/;
set $MAGE_MODE developers;
include /mnt/storage/demo-magento2/nginx.conf.sample;
}
And Nginx keeps returning me this error:
2015/10/19 18:15:04 [emerg] 6250#0: location "/setup" is outside location "/demos/demo-magento2/" in /mnt/storage/demo-magento2/nginx.conf.sample:27
I am quite new to Nginx, so can someone explains me how to figure it out?
/mnt/storage/demo/demo-magento2but in your location block you declare/mnt/storage/demo-magento2/, there is a mismatch already there. correct it already, maybe that's it