Forked from thiagolima-bm/set-multiple-magento-2-websites-stores-nginx
Last active
January 4, 2021 17:26
-
-
Save zeloc/760046dee16e6f2d0d51a3d5c9fd58df to your computer and use it in GitHub Desktop.
Configure Multiple Magento2 Websites or Stores with Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#etc/nginx/sites-available | |
map $http_host $MAGE_RUN_CODE { | |
ecc-m234-s1.vm ubs_view; | |
} | |
server { | |
listen 80; | |
server_name mystore.com mystore.de mystore.es; | |
set $MAGE_ROOT /path/to/your/magento2; | |
set $MAGE_MODE default; | |
include /path/to/your/magento2/nginx.conf.sample; | |
} | |
#path/to/magento/nginx.conf.sample | |
#... | |
# PHP entry point for main application | |
location ~ (index|get|static|report|404|503)\.php$ { | |
try_files $uri =404; | |
fastcgi_pass fastcgi_backend; | |
fastcgi_buffers 1024 4k; | |
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; | |
fastcgi_param PHP_VALUE "memory_limit=768M \n max_execution_time=600"; | |
fastcgi_read_timeout 600s; | |
fastcgi_connect_timeout 600s; | |
#add here - start | |
fastcgi_param MAGE_RUN_TYPE store; | |
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE; | |
#end | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
#... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When setting the above information:
the store code refers to the store view code
Steps:
map section and section at line 34