1

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"

1

As per your requirement if you have same categories, product, prices for every store. I suggest you to create different store views.

  1. Default - domain.com
  2. Second Store View - domain.in

Your can create store views from

Stores > All Stores > Create Store View

You can then configure the base url for each store view from configuration

Stores > Configuration > General > Web > Base Urls and Base Url (secure)

From store scope selection select your particular stores and change there respective urls.

You can change same product and set there description for each store views.

  • Thank you! I know this, but I have problem with nginx config maybe... – Sylon Oct 31 '16 at 6:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.