首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Magento安装重定向循环

Magento安装重定向循环
EN

Stack Overflow用户
提问于 2014-01-31 08:54:37
回答 4查看 4.3K关注 0票数 2

我试着用Nginx和php-fpm在我的VPS(在Linode上)上安装Magento Community Edition,但是我不能,我把Magento 1.8.1.0下载到我的服务器上。我创建了像Magento Wiki这样的nginx配置。但是当我请求我的域名时,它被302头重定向到'/index.php/install/‘路径,浏览器给出了无限循环错误。

你能给出一个解决方法吗?

编辑:我的nginx配置文件(我将真实域名替换为mydomain)

代码语言:javascript
复制
server {
  server_name mydomain.com www.mydomain.com;
  root "/home/mydomain/public_html";

  index index.php;
  client_max_body_size 10m;

    access_log /home/mydomain/_logs/access.log;
    error_log /home/mydomain/_logs/error.log;

    if ($http_user_agent ~* (Baiduspider|webalta|nikto|wkito|pikto|scan|acunetix|morfeus|webcollage|youdao) ) {
       return 401;
    }

    if ($http_user_agent ~* (HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) ) {
       return 401;
    }

    location / {
        index index.html index.php; ## Allow a static html file to be shown first
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
    }

    ## These locations would be hidden by .htaccess normally
    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/ { ## Allow admins only to view export folder
        auth_basic           "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex            on;
    }

    location  /. { ## Disable .htaccess and other hidden files
        return 404;
    }

    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ "^(.+\.php)($|/)" {
        if (!-e $request_filename) { rewrite / /index.php last;  }

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        fastcgi_param HTTPS $https;

        fastcgi_pass   unix:/var/run/mydomain_fpm.sock;
        include        fastcgi_params;
    }


    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
            access_log off;
    }

    location ~* \.(html|htm)$ {
        expires 30m;
    }

    location ~* /\.(ht|git|svn) {
        deny  all;
    }
}
EN

Stack Overflow用户

发布于 2014-02-06 14:55:25

请检查您的htaccess文件。如果存在,请检查现有规则

票数 -3
EN
查看全部 4 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21470645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档