Redirect magento自定义管理员url重定向到主页

Redirect magento自定义管理员url重定向到主页,redirect,nginx,magento-1.9,Redirect,Nginx,Magento 1.9,我们刚刚转移到另一台服务器,我们正在使用Nginx作为web服务 我们正在使用magento 1.9的自定义管理员url,如admin.domain.com 我可以通过以下url访问magento管理员: 那么,我是否可以仅使用此url访问它admin.domain.com 这是我的nginx配置 server { listen 888.888.888.888:80; server_name domain.com *.domain.com www.domain.com; root

我们刚刚转移到另一台服务器,我们正在使用Nginx作为web服务 我们正在使用magento 1.9的自定义管理员url,如admin.domain.com 我可以通过以下url访问magento管理员:

那么,我是否可以仅使用此url访问它admin.domain.com

这是我的nginx配置

server {
listen      888.888.888.888:80;
server_name domain.com *.domain.com www.domain.com;
root        /home/admin/web/domain.com/public_html;
index       index.php index.html index.htm;
access_log  /var/log/nginx/domains/domain.com.log combined;
access_log  /var/log/nginx/domains/domain.com.bytes bytes;
error_log   /var/log/nginx/domains/domain.com.error.log error;

location / {
    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$ {
    try_files $uri =404;
    expires off;
    fastcgi_read_timeout 900s;
    fastcgi_index index.php;
    fastcgi_pass 127.0.0.1:9002;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
}
rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;

location /lib/minify/ {
    allow all;
}
gzip on;
gzip_comp_level 6;
gzip_min_length  256;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

error_page  403 /error/404.html;
error_page  404 /error/404.html;
error_page  500 502 503 504 /error/50x.html;

location /error/ {
    alias   /home/admin/web/domain.com/document_errors/;
}

location ~* "/\.(htaccess|htpasswd)$" {
    deny    all;
    return  404;
}

location /vstats/ {
    alias   /home/admin/web/domain.com/stats/;
    include /home/admin/web/domain.com/stats/auth.conf*;
}

include     /etc/nginx/conf.d/phpmyadmin.inc*;
include     /etc/nginx/conf.d/phppgadmin.inc*;
include     /etc/nginx/conf.d/webmail.inc*;

include     /home/admin/conf/web/nginx.domain.com.conf*;
}

以下是您需要做的:

  • 创建两个精确的服务器

  • 确保文件已同步(根目录) /var/www/vhosts/example.com;)

  • 您的管理服务器将成为您的主服务器,您可以使用Lsync 确保它们始终同步

  • Domain admin.example.com将有一个IP和您的生产服务器 将有另一个Ip地址

  • 您可以使用相同的nginx配置文件

  • 在Magento中,您将为管理员选择自定义url并指向该url 到您的新管理服务器

  • 任何文件更改和上载都将转到管理员,并将同步 通过Lsync进程连接到从属服务器

  • 您可以通过ElastiCache运行Redis,也可以在管理员界面上运行它 服务器

  • 您应该为数据库服务器使用RDS 在REDIS中存储会话和缓存

  • 不要同步您的VAR文件夹

  • 我的前端和后端在同一台服务器上,我认为nginx配置需要用子域修复