首页 > 解决方案 > Magento 管理员在 nginx 上显示 ERR_TOO_MANY_REDIRECTS

问题描述

我正在尝试在单独的子域上设置 Magento 管理员,我正在关注本教程 [ https://magento2.atlassian.net/wiki/spaces/m1wiki/pages/14024833/Set+up+Magento+backend+on+a +separate+node]但以ERR_TOO_MANY_REDIRECTS错误告终。

我仅在访问时遇到问题,admin.example.com/index.php/admin或者admin.example.com但我可以访问admin.example.com/test.php.

下面是我的 nginx 配置文件,你能建议我缺少什么吗?

server {
    listen      80;
    server_name admin.example.com;
    keepalive_timeout   70;
    root        /var/www/html/example.prod;

    access_log /var/log/nginx/admin_access_log;
    error_log /var/log/nginx/admin_error_log;

    location / {
        return 301 http://admin.example.com/index.php/admin;
        #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 ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ \.php$ {
        try_files $uri =404;
        expires off;
        fastcgi_read_timeout 1800s;
        fastcgi_index index.php;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
    }
    gzip on;
    add_header "Access-Control-Allow-Origin" "*";
    gzip_min_length  1000;
    gzip_proxied any;
    gzip_types       text/plain application/xml text/css text/js application/x-javascript;
}

标签: phpmagentonginxmagento-1.9

解决方案


推荐阅读