nginx magento 多域名配置

following is a summary of the tasks you must perform. More details are provided in the sections that follow.

  1. Define websites, stores, and store views in the Magento Admin.
  2. Create one virtual host per Magento website or store view.
  3. Pass the values of MAGE_RUN_TYPE and MAGE_RUN_CODE to the web server.
server {
    listen 8080 default;
    server_name 44.55.222.101; 
    root /var/www/html;
    location / {
        index index.php index.html index.htm;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    location ^~ /app/ { deny all; }
    location ^~ /includes/           { deny all; }
    location ^~ /lib/                { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/            { deny all; }
    location ^~ /report/config.xml   { deny all; }
    location ^~ /var/                { deny all; }
    location /var/export/ {
        auth_basic           "Restricted";
        auth_basic_user_file htpasswd;
        autoindex            on;
    }
    location  /. {
        return 404;
    }
    location @handler {
        rewrite / /index.php;
    }
    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }
    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; } 
        expires        off;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE website_new; 
        fastcgi_param  MAGE_RUN_TYPE website;
        include        fastcgi_params; 
    }
}

相关推荐

magento 2.3 nginx 安装

在网上看了许多中文的magento2的安装教程,大多数都没有完整的安装步骤,本教程将教会你怎么使用和安装magento2.3 …

Magento忘记密码怎么办

如果你忘记 Magento 用户名和(或)密码无法登陆后台,并且forgot your password链接无法给你发送找回密码邮件,这 …

magento backend dashboard can’t log in – session error

可能很多朋友有同样的经历,magento在服务器中配置域名是可以正常的访问了,但是在本地配置后却无法登录后台,账号密码登录的时候发现出现空白,无法跳转到后台,本文章向大家介绍两种解决本地magento后台无法登录的方法,需要的朋友可以参考下

暂无评论

微信扫一扫,分享到朋友圈

nginx  magento 多域名配置