Using Nginx 1.4.6 on Ubuntu, I am trying to configure Magento 2 to run in a subfolder.
I already have some other projects in /var/www
that set up like this:
server {
server_name website.com;
root /var/www/;
location /p1/ {
}
location /p2/ {
}
}
But now my Magento installation is in /mnt/storage/demo/demo-magento2
, and I cannot find a way to include it in this server block.
I tried using my configuration for Nginx ( https://github.com/magento/magento2/wiki/Nginx-Configuration-Settings-and-Environment-Variables ). So, I added this location block to the 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 this error to me:
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 completely new to Nginx, so can someone explain to me how to understand this?