How to correctly write a config for a multi-language site? Is it right to make several blocks with redirects with www or is there a more compact option in one block as with the main domains? In the official documentation did not find ...

upstream fastcgi_backend { server unix:/var/run/php/php7.0-fpm.sock; } map $http_host $MAGE_RUN_CODE { domain.com default; domain.ru russian; } server { listen 80; server_name www.domain.com; return 301 $scheme://domain.com$request_uri; } server { listen 80; server_name www.domain.ru; return 301 $scheme://domain.ru$request_uri; } server { listen 80; server_name domain.com domain.ru; set $MAGE_ROOT /var/www/domain.com/html; set $MAGE_MODE default; } 

    1 answer 1

    Use 2 server sections if configs differ greatly for domains (one for each domain), or one section for both domains if the settings are similar (as they are now). For one section it is necessary to use internal variables.
    Redirects with www are used normally. Using several blocks with redirects is reasonable in your case. Would replace $ scheme with http.
    It’s hard to say something about the use of variables - there is little information. Summary - config file.