Skip to content

Instantly share code, notes, and snippets.

@jalogut
Last active April 4, 2018 12:44
Show Gist options
  • Save jalogut/0b79532c41a841cdecd71b34f2ab7c96 to your computer and use it in GitHub Desktop.
Save jalogut/0b79532c41a841cdecd71b34f2ab7c96 to your computer and use it in GitHub Desktop.
Set up multiple websites or stores with nginx
map $http_host $MAGE_RUN_CODE {
hostnames; # indicates that values can be hostnames with prefix or suffix mask.
default base;
*.ch ch;
*.de de;
*.at at;
}
server {
listen 443 ssl http2;
server_name <domains-list>;
set $MAGE_ROOT <magento_path>/pub;
set $MAGE_MODE production;
set $MAGE_RUN_TYPE website;
# Logs, FPM and other configs
include /var/www/html/magento2/nginx.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment