I have 2 domains: domain.com and domain.in Server: ubuntu 16, nginx 1.10, magento 2. Same product for both store, but diferent discription, url... The official documentation does not have this information with nginx config. Try this: Creat store view this code in. After: ./magento cron:run
Change config:
upstream fastcgi_backend {
server unix:/var/run/php/php7.0-fpm.sock;
}
map $http_host $MAGE_RUN_CODE {
domain.com default;
domain.in in;
}
server {
listen 80;
server_name www.domain.com;
return 301 $scheme://domain.com$request_uri;
}
server {
listen 80;
server_name www.domain.in;
return 301 $scheme://domain.in$request_uri;
}
server {
listen 80;
server_name domain.com domain.in;
set $MAGE_ROOT /var/www/domain.com/html;
set $MAGE_MODE default;
location = /robots.txt {
alias /var/www/domain.com/html/robots.txt;
}
location = /sitemap.xml {
alias /var/www/domain.com/html/sitemap.xml;
}
include /var/www/domain.com/html/nginx.conf.sample;
}
Insert to nginx.conf.sample:
fastcgi_param MAGE_RUN_TYPE website;
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
Site not open. Error: 2016/10/30 09:37:50 [error] 6345#6345: *29624 access forbidden by rule, client: 000.000.00.000, server: domain.com, request: "POST /app/etc/config.php HTTP/1.1", host: "domain.com"