2016-02-01 77 views
0

大家好我是新到magento的。我一直试图在Ubuntu 14.04LTS的nginx服务器上安装magento 1.9.0.0,但是我无法开始。我可以看到默认页面见下文为什么我不能访问Magento默认页面以外的其他页面?

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网页/不安全/ BASE_URL和网络/安全/ BASE_URL其他解决方案,他们包括我的基本URL。 我试过重新加载缓存。在nginx日志中没有任何内容。

谢谢你对我的帮助:-)

回答

0

你不会有任何的URI重定向到Magento的共同阵线处理程序。至少应添加:

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

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

+0

谢谢你的回答,我不知道我必须重定向到共同前线处理程序。我添加了你的线,但不幸的是,它仍然无法工作。我如何将每个URI重定向到前端处理程序?我也是nginx的新手 – kino

0

嗨,理查德史密斯说,我的虚拟主机错过了一些线路,以某种方式重定向到前端处理程序。正如我刚开始使用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; 
    } 


}