【问题标题】:Why can't I access other page than default page on Magento?为什么我不能访问 Magento 上默认页面以外的其他页面?
【发布时间】:2016-02-01 09:48:58
【问题描述】:

大家好,我是 magento 的新手。我一直在尝试在 Ubuntu 14.04LTS 上使用 nginx 服务器安装 magento 1.9.0.0,但我无法开始。我可以在下面看到默认页面

magento default page

但是每当我尝试登录时,服务器就会失败并出现无法连接的错误。

这是我的虚拟主机

server {
    listen   80;
    listen   [::]:80;
    server_name www.mymagento.com;
    root /var/www/magento;
    index index.php;
    #need it to execute php
    location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    include fastcgi_params;
    include fastcgi.conf;
    }

}

我已经尝试过其他解决方案,例如更新 core_config_data web/unsecure/base_url 和 web/secure/base_url 它们包含我的基本 url。 我尝试重新加载缓存。 nginx 日志中没有任何内容。

谢谢你帮助我:-)

【问题讨论】:

    标签: php nginx magento-1.9


    【解决方案1】:

    您无法将 URI 重定向到 Magento 通用前端处理程序。您至少应该添加:

    location / {
        try_files $uri $uri/ /index.php;
    }
    

    但我建议您查看this site 了解更多信息。

    【讨论】:

    • 感谢您的回答,我不知道我必须重定向到常见的前端处理程序。我添加了你的台词,但不幸的是,它仍然不起作用。如何将每个 URI 重定向到前端处理程序?我也是 nginx 新手
    【解决方案2】:

    正如 Richard SMITH 所说,您好,我的虚拟主机缺少一些行,无法以某种方式重定向到前端处理程序。由于我刚刚开始使用 Nginx,所以我无法解释每一行,但是在使用 Nginx 后,这个配置对我有用(我还需要在配置中添加自签名证书才能使其工作)。

    server {
        listen   80;
        listen   [::]:80;
        listen 443 default ssl;
        server_name www.mymagento.com;
        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;
        root /var/www/magento;
        index index.php;
    
    
        location / {
                index index.html index.php;
                autoindex on;
                #If missing pass the URI to Magento's front handler
                try_files $uri $uri/ @handler;
                expires max; 
     }
    
        #need it to execute php
        location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        include fastcgi_params;
        include fastcgi.conf;
        }
    
        ## Magento uses a common front handler
        location @handler {
        rewrite / /index.php;
        }
    
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-08
      • 2016-10-06
      • 1970-01-01
      • 2014-02-01
      • 2020-12-20
      • 2015-02-05
      • 2010-12-05
      相关资源
      最近更新 更多