2016-02-01 127 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; 
    } 


}