Magento管理员在nginx上显示ERR_TOO_MANY_REDIRECTS

时间:2019-05-10 11:37:39

标签: php magento nginx magento-1.9

我正在尝试在单独的子域上设置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/adminadmin.example.com时遇到问题,但是我可以访问admin.example.com/test.php

下面是我的nginx conf文件,请您提示我所缺少的内容。

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;
}

0 个答案:

没有答案